File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ var required = require('requires-port')
6
6
, slashes = / ^ [ A - Z a - z ] [ A - Z a - z 0 - 9 + - . ] * : \/ \/ /
7
7
, protocolre = / ^ ( [ a - z ] [ a - z 0 - 9 . + - ] * : ) ? ( \/ \/ ) ? ( [ \\ / ] + ) ? ( [ \S \s ] * ) / i
8
8
, windowsDriveLetter = / ^ [ a - z A - Z ] : /
9
- , whitespace = / ^ [ \f \n \r \t \v \u00a0 \u1680 \u2000 - \u200a \u2028 \u2029 \u202f \u205f \u3000 \ufeff ] + / ;
9
+ , whitespace = / ^ [ \x00 - \x20 \u00a0 \u1680 \u2000 - \u200a \u2028 \u2029 \u202f \u205f \u3000 \ufeff ] + / ;
10
10
11
11
/**
12
12
* Trim a given string.
Original file line number Diff line number Diff line change @@ -47,8 +47,14 @@ describe('url-parse', function () {
47
47
assume ( parse . trimLeft ) . is . a ( 'function' ) ;
48
48
} ) ;
49
49
50
- it ( 'removes whitespace on the left' , function ( ) {
51
- assume ( parse . trimLeft ( ' lol' ) ) . equals ( 'lol' ) ;
50
+ it ( 'removes control characters on the left' , function ( ) {
51
+ var i = 0 ;
52
+ var prefix = ''
53
+
54
+ for ( ; i < 33 ; i ++ ) {
55
+ prefix = String . fromCharCode ( i ) ;
56
+ assume ( parse . trimLeft ( prefix + prefix + 'lol' ) ) . equals ( 'lol' ) ;
57
+ }
52
58
} ) ;
53
59
54
60
it ( 'calls toString on a given value' , function ( ) {
You can’t perform that action at this time.
0 commit comments