File tree 5 files changed +2
-29
lines changed
5 files changed +2
-29
lines changed Original file line number Diff line number Diff line change 19
19
### ` escape (literal: string) => string `
20
20
21
21
Returns an escaped version of a string for use in a regular expression.
22
-
23
- ### ` unwrap (exp: RegExp) => string `
24
-
25
- Returns a string containing just the pattern portion of a regular expression.
Original file line number Diff line number Diff line change 1
- export { escape , unwrap } from './main'
1
+ export { escape } from './main'
Original file line number Diff line number Diff line change 9
9
* SyntaxError: Invalid regular expression: <expression>: Invalid escape
10
10
*/
11
11
export const escape : ( literal : string ) => string = literal => literal . replace ( / [ | \\ { } ( ) [ \] ^ $ + * ? . ] / g, '\\$&' )
12
-
13
- /**
14
- * Returns a string containing just the pattern portion of a regular expression.
15
- *
16
- * The surrounding delimiters, and the flags/modifiers will be omitted.
17
- */
18
- export const unwrap : ( exp : RegExp ) => string = exp => String ( exp ) . split ( '/' ) . slice ( 1 , - 1 ) . join ( '/' )
Original file line number Diff line number Diff line change 1
1
import * as index from '../../src/index'
2
- import { escape , unwrap } from '../../src/main'
2
+ import { escape } from '../../src/main'
3
3
4
4
describe ( 'module index' , ( ) => {
5
5
it ( 'should provide access to param()' , ( ) => {
6
6
expect ( index . escape ) . toBe ( escape )
7
7
} )
8
-
9
- it ( 'should provide access to path()' , ( ) => {
10
- expect ( index . unwrap ) . toBe ( unwrap )
11
- } )
12
8
} )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments