Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed May 11, 2022
1 parent 17b27b2 commit 23aa15b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 33 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/npm_downloads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/productionize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions is-blank-string/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
* limitations under the License.
*/

/* eslint-disable no-new-wrappers, no-undefined, no-empty-function */

'use strict';

// MODULES //
Expand Down Expand Up @@ -49,7 +47,7 @@ bench( pkg, function benchmark( b ) {
true,
false,
null,
undefined
void 0
];

b.tic();
Expand Down
31 changes: 3 additions & 28 deletions is-blank-string/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 //
Expand Down Expand Up @@ -86,7 +61,7 @@ function isBlankString( value ) {
if ( !isString( value ) ) {
return false;
}
return RE_ONLY_WHITESPACE.test( value );
return RE.test( value );
}


Expand Down

0 comments on commit 23aa15b

Please sign in to comment.