File tree Expand file tree Collapse file tree 2 files changed +4
-31
lines changed
lib/node_modules/@stdlib/assert/is-blank-string Expand file tree Collapse file tree 2 files changed +4
-31
lines changed Original file line number Diff line number Diff line change 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 ( ) ;
Original file line number Diff line number Diff line change 2121// MODULES //
2222
2323var 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
You can’t perform that action at this time.
0 commit comments