From cb42b6d59d23209123544bc540640d49a5e65c06 Mon Sep 17 00:00:00 2001 From: Franklin Koch Date: Mon, 9 Jun 2025 13:54:50 -0600 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A7=B9=20Remove=20additional=20suffix?= =?UTF-8?q?=20in=20biorxiv=20resolver?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.spec.ts | 10 ++++++++++ src/resolvers.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/index.spec.ts b/src/index.spec.ts index 4153a1e..146bac8 100644 --- a/src/index.spec.ts +++ b/src/index.spec.ts @@ -115,6 +115,16 @@ describe('external DOI links', () => { 'https://www.biorxiv.org/content/10.1101/2020.11.02.364968v2', '10.1101/2020.11.02.364968', ], + [ + 'biorxiv', + 'https://www.biorxiv.org/content/10.1101/2020.11.02.364968v1.full', + '10.1101/2020.11.02.364968', + ], + [ + 'biorxiv', + 'https://www.biorxiv.org/content/10.1101/2020.11.02.364968v23.article-metrics', + '10.1101/2020.11.02.364968', + ], ])('Test %s (%s) <%s>', (_, url, doiString) => { expect(doi.normalize(url)).toBe(doiString); expect(doi.validate(url)).toBe(doiString ? true : false); diff --git a/src/resolvers.ts b/src/resolvers.ts index b48b77f..891553d 100644 --- a/src/resolvers.ts +++ b/src/resolvers.ts @@ -45,7 +45,7 @@ const biorxiv: Resolver = { parse(url) { return clumpParts(url) .find(validatePart) - ?.replace(/v([\d]*)$/, ''); + ?.replace(/v\d+(\.[a-zA-Z-]+)?$/, ''); }, }; From 5cb21c4ab6695cbad135ff699322588e2d995c36 Mon Sep 17 00:00:00 2001 From: Franklin Koch Date: Mon, 9 Jun 2025 14:00:00 -0600 Subject: [PATCH 2/2] Update action step versions --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1ce25d..958de42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,11 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 2 submodules: recursive - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: node-version: 20.x - run: npm install @@ -28,12 +28,12 @@ jobs: node: ['18', '20', '22'] name: Testing on node ${{ matrix.node }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 2 submodules: recursive - name: Setup Node.js environment - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: 'npm'