From d0e40878ea17c1b11453b1e81aa281a2f10ed626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Thu, 7 Nov 2024 15:31:51 +0800 Subject: [PATCH] chore: update --- .github/workflows/publish-babel-plugin-canyon.yml | 2 +- plugins/babel-plugin-canyon/package.json | 2 +- plugins/babel-plugin-canyon/src/index.js | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-babel-plugin-canyon.yml b/.github/workflows/publish-babel-plugin-canyon.yml index 914c2c37..642e8865 100644 --- a/.github/workflows/publish-babel-plugin-canyon.yml +++ b/.github/workflows/publish-babel-plugin-canyon.yml @@ -21,6 +21,6 @@ jobs: env: NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} - run: | - pnpm dist-tag add babel-plugin-canyon@1.8.84 latest + pnpm dist-tag add babel-plugin-canyon@1.8.85 latest env: NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} diff --git a/plugins/babel-plugin-canyon/package.json b/plugins/babel-plugin-canyon/package.json index 8f114fa2..7b678a70 100644 --- a/plugins/babel-plugin-canyon/package.json +++ b/plugins/babel-plugin-canyon/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-canyon", - "version": "1.8.84", + "version": "1.8.85", "description": "A Babel plugin cooperates with istanbul to report the coverage", "author": "Allen Zhang ", "license": "MIT", diff --git a/plugins/babel-plugin-canyon/src/index.js b/plugins/babel-plugin-canyon/src/index.js index 4c3b3511..4c2b1179 100644 --- a/plugins/babel-plugin-canyon/src/index.js +++ b/plugins/babel-plugin-canyon/src/index.js @@ -38,6 +38,14 @@ function newAtob() { } const newatob = newAtob() +function analyzeIntervalTime (intervalTime) { + if (!isNaN(Number(intervalTime))){ + return intervalTime + } else { + return '0' + } +} + export default declare((api,config) => { api.assertVersion(7) return { @@ -58,7 +66,7 @@ export default declare((api,config) => { BRANCH: config.branch || '-', REPORT_ID: config.reportID || '-', COMPARE_TARGET: config.compareTarget || '-', - INTERVAL_TIME: config.intervalTime || '0', + INTERVAL_TIME: analyzeIntervalTime(config.intervalTime), VERSION: packageJson.version || '-' }