Skip to content

Commit 5035cc3

Browse files
committed
Auto-generated commit
1 parent 0ba92a3 commit 5035cc3

File tree

24 files changed

+1058
-18
lines changed

24 files changed

+1058
-18
lines changed

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
benchmark:
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
- uses: actions/setup-node@v2
3333
with:
3434
node-version: 16

.github/workflows/bundle.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ on:
2525
push:
2626
branches:
2727
- main
28-
tags_ignore:
28+
tags-ignore:
2929
- 'v[0-9]+\.[0-9]+\.[0-9]+'
3030

3131
# Workflow jobs:
3232
jobs:
3333
deno:
3434
runs-on: ubuntu-latest
3535
steps:
36-
- uses: actions/checkout@v2
36+
- uses: actions/checkout@v3
3737
- name: Copy files to deno directory
3838
run: |
3939
mkdir -p deno
@@ -92,7 +92,7 @@ jobs:
9292
github_token: ${{ secrets.GITHUB_TOKEN }}
9393
publish_dir: ./deno
9494
publish_branch: deno
95-
keep_files: true
95+
force_orphan: true
9696
user_name: 'stdlib-bot'
9797
user_email: 'noreply@stdlib.io'
9898
commit_message: 'Auto-generated commit'
@@ -107,7 +107,7 @@ jobs:
107107
umd:
108108
runs-on: ubuntu-latest
109109
steps:
110-
- uses: actions/checkout@v2
110+
- uses: actions/checkout@v3
111111
- name: Copy files to umd directory
112112
run: |
113113
mkdir -p umd
@@ -153,7 +153,7 @@ jobs:
153153
find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "1 while s/<script type=\"text\/javascript\">\n(var|let|const)\s+([a-zA-Z0-9_]+)\s+=\s*require\( '\@stdlib\/([^']+)' \);?/<script type=\"text\/javascript\" src=\"https:\/\/cdn.jsdelivr.net\/gh\/stdlib-js\/\3\@umd\/bundle.js\"><\/script>\n<script type=\"text\/javascript\">/g"
154154
155155
# Wrap contents of `<script type="text/javascript">` tag contents in an IIFE:
156-
find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<script type=\"text\/javascript\">([\s\S]+?)<\/script>/<script type=\"text\/javascript\">\n\(function \(\) {\1}\)\(\)\n<\/script>/g"
156+
find ./umd -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<script type=\"text\/javascript\">([\s\S]+?)<\/script>/<script type=\"text\/javascript\">\n\(function \(\) {\1}\)\(\);\n<\/script>/g"
157157
158158
# Create package.json file for umd branch:
159159
jq --indent 2 '{"name": .name, "version": .version, "description": .description, "license": .license, "main": "./bundle.js", "homepage": .homepage, "repository": .repository, "bugs": .bugs, "keywords": .keywords, "funding": .funding}' package.json > ./umd/package.json
@@ -164,7 +164,7 @@ jobs:
164164
github_token: ${{ secrets.GITHUB_TOKEN }}
165165
publish_dir: ./umd
166166
publish_branch: umd
167-
keep_files: true
167+
force_orphan: true
168168
user_name: 'stdlib-bot'
169169
user_email: 'noreply@stdlib.io'
170170
commit_message: 'Auto-generated commit'
@@ -179,7 +179,7 @@ jobs:
179179
esm:
180180
runs-on: ubuntu-latest
181181
steps:
182-
- uses: actions/checkout@v2
182+
- uses: actions/checkout@v3
183183
- name: Copy files to umd directory
184184
run: |
185185
mkdir -p esm
@@ -242,7 +242,7 @@ jobs:
242242
github_token: ${{ secrets.GITHUB_TOKEN }}
243243
publish_dir: ./esm
244244
publish_branch: esm
245-
keep_files: true
245+
force_orphan: true
246246
user_name: 'stdlib-bot'
247247
user_email: 'noreply@stdlib.io'
248248
commit_message: 'Auto-generated commit'

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
examples:
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v3
3232
- uses: actions/setup-node@v2
3333
with:
3434
node-version: 16

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
env:
3232
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
3535
- uses: actions/setup-node@v2
3636
with:
3737
node-version: 16
@@ -63,7 +63,7 @@ jobs:
6363
runs-on: ubuntu-latest
6464
steps:
6565
- name: Checkout main branch
66-
uses: actions/checkout@v2
66+
uses: actions/checkout@v3
6767
with:
6868
ref: main
6969
- name: Increment version in `package.json` to the version number of the tag

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
env:
3535
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3636
steps:
37-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v3
3838
- uses: actions/setup-node@v2
3939
with:
4040
node-version: 16

.github/workflows/test_bundles.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3535
steps:
3636
- name: Checkout branch with UMD build
37-
uses: actions/checkout@v2
37+
uses: actions/checkout@v3
3838
with:
3939
ref: umd
4040
- name: Setup Node.js
@@ -57,7 +57,7 @@ jobs:
5757
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
5858
steps:
5959
- name: Checkout branch with ESM build
60-
uses: actions/checkout@v2
60+
uses: actions/checkout@v3
6161
with:
6262
ref: esm
6363
- name: Setup Node.js
@@ -80,7 +80,7 @@ jobs:
8080
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
8181
steps:
8282
- name: Checkout branch with Deno build
83-
uses: actions/checkout@v2
83+
uses: actions/checkout@v3
8484
with:
8585
ref: deno
8686
- name: Install Deno

.github/workflows/test_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
test:
3232
runs-on: ubuntu-latest
3333
steps:
34-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
3535
- uses: actions/setup-node@v2
3636
with:
3737
node-version: 16

.github/workflows/test_install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
3838
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
3939
steps:
40-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v3
4141
- uses: actions/setup-node@v2
4242
with:
4343
node-version: 16

is-blank-string/README.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2022 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# isBlankString
22+
23+
> Test if a value is a blank string.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var isBlankString = require( '@stdlib/assert/is-blank-string' );
31+
```
32+
33+
#### isBlankString( value )
34+
35+
Tests if a `value` is a blank `string` (i.e., an empty string or a string consisting only of whitespace characters).
36+
37+
```javascript
38+
var bool = isBlankString( ' ' );
39+
// returns true
40+
41+
bool = isBlankString( '' );
42+
// returns true
43+
44+
bool = isBlankString( 0 );
45+
// returns false
46+
```
47+
48+
</section>
49+
50+
<!-- /.usage -->
51+
52+
<section class="examples">
53+
54+
## Examples
55+
56+
<!-- eslint no-undef: "error" -->
57+
58+
```javascript
59+
var isBlankString = require( '@stdlib/assert/is-blank-string' );
60+
61+
var out = isBlankString( ' ' );
62+
// returns true
63+
64+
out = isBlankString( '\t\t\t' );
65+
// returns true
66+
67+
out = isBlankString( '\r\n' );
68+
// returns true
69+
70+
out = isBlankString( '' );
71+
// returns true
72+
73+
out = isBlankString( 'beep boop' );
74+
// returns false
75+
76+
out = isBlankString( null );
77+
// returns false
78+
```
79+
80+
</section>
81+
82+
<!-- /.examples -->
83+
84+
* * *
85+
86+
<section class="cli">
87+
88+
## CLI
89+
90+
<section class="usage">
91+
92+
### Usage
93+
94+
```text
95+
Usage: is-blank-string [options] [<string>]
96+
97+
Options:
98+
99+
-h, --help Print this message.
100+
-V, --version Print the package version.
101+
```
102+
103+
</section>
104+
105+
<!-- /.usage -->
106+
107+
<section class="examples">
108+
109+
### Examples
110+
111+
```bash
112+
$ is-blank-string baz
113+
false
114+
```
115+
116+
To use as a [standard stream][standard-streams],
117+
118+
```bash
119+
$ echo -n ' \t ' | is-blank-string
120+
true
121+
```
122+
123+
</section>
124+
125+
<!-- /.examples -->
126+
127+
</section>
128+
129+
<!-- /.cli -->
130+
131+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
132+
133+
<section class="related">
134+
135+
<!-- /.related -->
136+
137+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
138+
139+
<section class="links">
140+
141+
[standard-streams]: https://en.wikipedia.org/wiki/Standard_streams
142+
143+
<!-- <related-links> -->
144+
145+
<!-- </related-links> -->
146+
147+
</section>
148+
149+
<!-- /.links -->
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2022 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/* eslint-disable no-new-wrappers, no-undefined, no-empty-function */
20+
21+
'use strict';
22+
23+
// MODULES //
24+
25+
var bench = require( '@stdlib/bench' );
26+
var isBoolean = require( './../../is-boolean' ).isPrimitive;
27+
var pkg = require( './../package.json' ).name;
28+
var isBlankString = require( './../lib' );
29+
30+
31+
// MAIN //
32+
33+
bench( pkg, function benchmark( b ) {
34+
var values;
35+
var bool;
36+
var i;
37+
38+
values = [
39+
'',
40+
'5',
41+
' ',
42+
'\t',
43+
'\n',
44+
'\r\n \t\t\t',
45+
'\u00A0',
46+
'\u2000',
47+
5,
48+
NaN,
49+
true,
50+
false,
51+
null,
52+
undefined
53+
];
54+
55+
b.tic();
56+
for ( i = 0; i < b.iterations; i++ ) {
57+
bool = isBlankString( values[ i % values.length ] );
58+
if ( !isBoolean( bool ) ) {
59+
b.fail( 'should return a boolean' );
60+
}
61+
}
62+
b.toc();
63+
if ( !isBoolean( bool ) ) {
64+
b.fail( 'should return a boolean' );
65+
}
66+
b.pass( 'benchmark finished' );
67+
b.end();
68+
});

0 commit comments

Comments
 (0)