From f637200a28275807a7203916f8bcb3d87e66ce97 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Sun, 28 Mar 2021 18:59:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20releases=E9=A1=B5=E9=9D=A2=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=8A=A0=E9=80=9F=E4=B8=8B=E8=BD=BD=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/config/index.js | 2 +- packages/core/test/regex.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/config/index.js b/packages/core/src/config/index.js index 859cb31..9c2be41 100644 --- a/packages/core/src/config/index.js +++ b/packages/core/src/config/index.js @@ -50,7 +50,7 @@ module.exports = { '/.*/.*/blame/': { redirect: 'hub.fastgit.org' }, - '^/[^/]+/[^/]+/?(/releases)?$': { + '^/[^/]+/[^/]+(/releases(/.*)?)?$': { script: [ 'jquery', 'github' diff --git a/packages/core/test/regex.test.js b/packages/core/test/regex.test.js index e1ddfd0..93a7cac 100644 --- a/packages/core/test/regex.test.js +++ b/packages/core/test/regex.test.js @@ -3,10 +3,10 @@ var expect = require('chai').expect describe('test', function () { // eslint-disable-next-line no-undef it('regexp', function () { - const test = '^/[^/]+/[^/]+(/releases)?$' + const test = '^/[^/]+/[^/]+(/releases(/.*)?)?$' const reg = new RegExp(test) - const ret = reg.test('/docmirror/dev-sidecar/releases') + const ret = reg.test('/docmirror/dev-sidecar/releases/tag') // eslint-disable-next-line no-unused-expressions expect(ret).be.ok })