Skip to content

Commit 260f6ec

Browse files
committed
Use regex package and remove unused lint directives
1 parent 3567b60 commit 260f6ec

File tree

2 files changed

+4
-31
lines changed

2 files changed

+4
-31
lines changed

lib/node_modules/@stdlib/assert/is-blank-string/benchmark/benchmark.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
/* eslint-disable no-new-wrappers, no-undefined, no-empty-function */
20-
2119
'use strict';
2220

2321
// MODULES //
@@ -49,7 +47,7 @@ bench( pkg, function benchmark( b ) {
4947
true,
5048
false,
5149
null,
52-
undefined
50+
void 0
5351
];
5452

5553
b.tic();

lib/node_modules/@stdlib/assert/is-blank-string/lib/main.js

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,12 @@
2121
// MODULES //
2222

2323
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
24+
var reWhitespace = require( '@stdlib/regexp/whitespace' );
2425

2526

2627
// VARIABLES //
2728

28-
/**
29-
* Matches a string containing only whitespace characters.
30-
*
31-
* - `^`
32-
* - match any string which begins with
33-
*
34-
* - `[`
35-
* - begin character set
36-
*
37-
* - `\s`
38-
* - match any whitespace character (spaces, tabs, line breaks; not sufficient to capture all whitespace on older browsers such as IE7)
39-
*
40-
* - `\uFEFF`
41-
* - match Unicode zero-width no-break space (BOM character)
42-
*
43-
* - `\xA0`
44-
* - match Unicode non-breaking space
45-
*
46-
* - `]`
47-
* - end character set
48-
*
49-
* @private
50-
* @constant
51-
* @type {RegExp}
52-
* @default /^[\s\uFEFF\xA0]*$/
53-
*/
54-
var RE_ONLY_WHITESPACE = /^[\s\uFEFF\xA0]*$/;
29+
var RE = new RegExp( '^' + reWhitespace.REGEXP.source + '*$' );
5530

5631

5732
// MAIN //
@@ -86,7 +61,7 @@ function isBlankString( value ) {
8661
if ( !isString( value ) ) {
8762
return false;
8863
}
89-
return RE_ONLY_WHITESPACE.test( value );
64+
return RE.test( value );
9065
}
9166

9267

0 commit comments

Comments
 (0)