File tree Expand file tree Collapse file tree 5 files changed +2
-29
lines changed Expand file tree Collapse file tree 5 files changed +2
-29
lines changed Original file line number Diff line number Diff line change 1919### ` escape (literal: string) => string `
2020
2121Returns 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 99 * SyntaxError: Invalid regular expression: <expression>: Invalid escape
1010 */
1111export 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 11import * as index from '../../src/index'
2- import { escape , unwrap } from '../../src/main'
2+ import { escape } from '../../src/main'
33
44describe ( 'module index' , ( ) => {
55 it ( 'should provide access to param()' , ( ) => {
66 expect ( index . escape ) . toBe ( escape )
77 } )
8-
9- it ( 'should provide access to path()' , ( ) => {
10- expect ( index . unwrap ) . toBe ( unwrap )
11- } )
128} )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments