From 23aa15b2b47aa666a6ca09d80e959c2f29ebdc7e Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Wed, 11 May 2022 19:38:33 +0000 Subject: [PATCH] Auto-generated commit --- .github/.keepalive | 1 - .github/workflows/npm_downloads.yml | 7 ++++++ .github/workflows/productionize.yml | 2 +- .github/workflows/test_coverage.yml | 14 ++++++++++++ is-blank-string/benchmark/benchmark.js | 4 +--- is-blank-string/lib/main.js | 31 +++----------------------- 6 files changed, 26 insertions(+), 33 deletions(-) delete mode 100644 .github/.keepalive diff --git a/.github/.keepalive b/.github/.keepalive deleted file mode 100644 index 84aea29f..00000000 --- a/.github/.keepalive +++ /dev/null @@ -1 +0,0 @@ -2022-05-01T01:52:14.784Z diff --git a/.github/workflows/npm_downloads.yml b/.github/workflows/npm_downloads.yml index c7b714e7..7ca169ca 100644 --- a/.github/workflows/npm_downloads.yml +++ b/.github/workflows/npm_downloads.yml @@ -75,6 +75,13 @@ jobs: echo "::set-output name=data::$data" timeout-minutes: 5 + # Print summary of download data: + - name: 'Print summary' + run: | + echo "| Date | Downloads |" >> $GITHUB_STEP_SUMMARY + echo "|------|------------|" >> $GITHUB_STEP_SUMMARY + cat ./tmp/npm_downloads.json | jq -r ".downloads | .[-14:] | to_entries | map(\"| \(.value.day) | \(.value.downloads) |\") |.[]" >> $GITHUB_STEP_SUMMARY + # Upload the download data: - name: 'Upload data' uses: actions/upload-artifact@v2 diff --git a/.github/workflows/productionize.yml b/.github/workflows/productionize.yml index 47904249..f51cab7f 100644 --- a/.github/workflows/productionize.yml +++ b/.github/workflows/productionize.yml @@ -117,7 +117,7 @@ jobs: runs-on: 'ubuntu-latest' # Indicate that this job depends on the prior job finishing: - needs: test + needs: productionize # Run this job regardless of the outcome of the prior job: if: always() diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index 488ede50..a8f3eb56 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -90,6 +90,20 @@ jobs: coverage=`cat reports/coverage/lcov-report/index.html | grep "fraction" | grep -oP '\d+/\d+' | printf %s "$(cat)" | jq -R -s -c 'split("\n")'` echo "::set-output name=coverage::$coverage" + # Format coverage as Markdown table row: + table=`echo $coverage | sed -e 's/,/|/g; s/"/ /g; s/\[/|/; s/\]/|/'` + echo "::set-output name=table::$table" + + # Print coverage report to GitHub Actions log: + - name: 'Print coverage report to GitHub Actions log' + run: | + echo "## Coverage Report" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "| Statements | Branches | Functions | Lines | " >> $GITHUB_STEP_SUMMARY + echo "| ---------- | -------- | --------- | ----- | " >> $GITHUB_STEP_SUMMARY + echo "${{ steps.extract-coverage.outputs.table }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + # Send Slack notification if job fails: - name: 'Send status to Slack channel in case of failure' uses: act10ns/slack@v1 diff --git a/is-blank-string/benchmark/benchmark.js b/is-blank-string/benchmark/benchmark.js index 0ce28501..1af68998 100644 --- a/is-blank-string/benchmark/benchmark.js +++ b/is-blank-string/benchmark/benchmark.js @@ -16,8 +16,6 @@ * limitations under the License. */ -/* eslint-disable no-new-wrappers, no-undefined, no-empty-function */ - 'use strict'; // MODULES // @@ -49,7 +47,7 @@ bench( pkg, function benchmark( b ) { true, false, null, - undefined + void 0 ]; b.tic(); diff --git a/is-blank-string/lib/main.js b/is-blank-string/lib/main.js index 8291c1c3..c57ae23a 100644 --- a/is-blank-string/lib/main.js +++ b/is-blank-string/lib/main.js @@ -21,37 +21,12 @@ // MODULES // var isString = require( './../../is-string' ).isPrimitive; +var reWhitespace = require( '@stdlib/regexp/whitespace' ); // VARIABLES // -/** -* Matches a string containing only whitespace characters. -* -* - `^` -* - match any string which begins with -* -* - `[` -* - begin character set -* -* - `\s` -* - match any whitespace character (spaces, tabs, line breaks; not sufficient to capture all whitespace on older browsers such as IE7) -* -* - `\uFEFF` -* - match Unicode zero-width no-break space (BOM character) -* -* - `\xA0` -* - match Unicode non-breaking space -* -* - `]` -* - end character set -* -* @private -* @constant -* @type {RegExp} -* @default /^[\s\uFEFF\xA0]*$/ -*/ -var RE_ONLY_WHITESPACE = /^[\s\uFEFF\xA0]*$/; +var RE = new RegExp( '^' + reWhitespace.REGEXP.source + '*$' ); // MAIN // @@ -86,7 +61,7 @@ function isBlankString( value ) { if ( !isString( value ) ) { return false; } - return RE_ONLY_WHITESPACE.test( value ); + return RE.test( value ); }