Skip to content

Commit

Permalink
implementing #30
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaly-t committed May 3, 2020
1 parent d2e6dfe commit 8c20e59
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "connection-string",
"version": "3.2.1",
"version": "3.2.2",
"description": "Advanced URL Connection String parser + generator.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function hasText(txt?: string): boolean {
}

export function validateUrl(url: string): void {
const idx = url.search(/[^A-Za-z0-9-._~:/?[\]@!$&'()*+,;=%]/);
const idx = url.search(/[^A-Za-z0-9-._:/?[\]@!$&'()*+,;=%]/);
if (idx >= 0) {
const s = JSON.stringify(url[idx]).replace(/^"|"$/g, `'`);
throw new Error(`Invalid URL character ${s} at position ${idx}`);
Expand Down
2 changes: 1 addition & 1 deletion test/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('constructor', () => {
}).to.throw(error + 123);
});
it('must throw on invalid symbols', () => {
const invalidSymbols = '`"#^<>{}\\| \r\n\t';
const invalidSymbols = '~`"#^<>{}\\| \r\n\t';
invalidSymbols.split('').forEach(s => {
const a = JSON.stringify(s).replace(/^"|"$/g, '\'');
expect(() => {
Expand Down

0 comments on commit 8c20e59

Please sign in to comment.