diff --git a/modules/rules.ts b/modules/rules.ts index 0e178e1..657d6a1 100644 --- a/modules/rules.ts +++ b/modules/rules.ts @@ -1,6 +1,6 @@ export const defaultOrConstrained = (match: string): string => '(' + - (match ? match.replace(/(^<|>$)/g, '') : "[a-zA-Z0-9-_.~%':|=]+") + + (match ? match.replace(/(^<|>$)/g, '') : "[a-zA-Z0-9-_.~%':|=+]+") + ')' export type RegExpFactory = (match: any) => RegExp diff --git a/test/main.js b/test/main.js index e641eef..66dabb7 100644 --- a/test/main.js +++ b/test/main.js @@ -280,4 +280,12 @@ describe('Path', function() { param: '1|2' }) }) + + it('should support a wide range of characters', () => { + const path = new Path('/test/:param') + + path.test('/test/1+2=3').should.eql({ + param: '1+2=3' + }) + }) })