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 || '-' }