File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
lib/node_modules/@stdlib/string/trim/lib Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 2121// MODULES //
2222
2323var isString = require ( '@stdlib/assert/is-string' ) . isPrimitive ;
24- var replace = require ( '@stdlib/string/base/replace' ) ;
2524var format = require ( '@stdlib/string/format' ) ;
26-
27-
28- // VARIABLES //
29-
30- // The following regular expression should suffice to polyfill (most?) all environments.
31- var RE = / ^ [ \u0020 \f \n \r \t \v \u00a0 \u1680 \u2000 - \u200a \u2028 \u2029 \u202f \u205f \u3000 \ufeff ] * ( [ \S \s ] * ?) [ \u0020 \f \n \r \t \v \u00a0 \u1680 \u2000 - \u200a \u2028 \u2029 \u202f \u205f \u3000 \ufeff ] * $ / ;
25+ var base = require ( '@stdlib/string/base/trim' ) ;
3226
3327
3428// MAIN //
@@ -56,7 +50,7 @@ function trim( str ) {
5650 if ( ! isString ( str ) ) {
5751 throw new TypeError ( format ( 'invalid argument. Must provide a string. Value: `%s`.' , str ) ) ;
5852 }
59- return replace ( str , RE , '$1' ) ;
53+ return base ( str ) ;
6054}
6155
6256
You can’t perform that action at this time.
0 commit comments