Skip to content

Commit

Permalink
feat: support sign in parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
troch committed May 14, 2018
1 parent f1afdab commit adc36b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/rules.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
})
})
})

0 comments on commit adc36b0

Please sign in to comment.