| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,7 @@ var required = require('requires-port') | |||
| 6 | 6 | , slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\// | |
| 7 | 7 | , protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i | |
| 8 | 8 | , windowsDriveLetter = /^[a-zA-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 () { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments