File tree 2 files changed +17
-17
lines changed 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 47
47
"devDependencies" : {
48
48
"ava" : " *" ,
49
49
"coveralls" : " ^2.11.2" ,
50
- "execa" : " ^0.7 .0" ,
50
+ "execa" : " ^0.8 .0" ,
51
51
"import-fresh" : " ^2.0.0" ,
52
52
"matcha" : " ^0.7.0" ,
53
53
"nyc" : " ^11.0.2" ,
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
- const TEMPLATE_REGEX = / (?: \\ ( u [ a - f 0 - 9 ] { 4 } | x [ a - f 0 - 9 ] { 2 } | .) ) | (?: \{ ( ~ ) ? ( \w + (?: \( [ ^ ) ] * \) ) ? (?: \. \w + (?: \( [ ^ ) ] * \) ) ? ) * ) (?: [ \t ] | (? = \r ? \n ) ) ) | ( \} ) | ( (?: .| [ \r \n \f ] ) + ?) / gi;
2
+ const TEMPLATE_REGEX = / (?: \\ ( u [ a - f \d ] { 4 } | x [ a - f \d ] { 2 } | .) ) | (?: \{ ( ~ ) ? ( \w + (?: \( [ ^ ) ] * \) ) ? (?: \. \w + (?: \( [ ^ ) ] * \) ) ? ) * ) (?: [ \t ] | (? = \r ? \n ) ) ) | ( \} ) | ( (?: .| [ \r \n \f ] ) + ?) / gi;
3
3
const STYLE_REGEX = / (?: ^ | \. ) ( \w + ) (?: \( ( [ ^ ) ] * ) \) ) ? / g;
4
4
const STRING_REGEX = / ^ ( [ ' " ] ) ( (?: \\ .| (? ! \1) [ ^ \\ ] ) * ) \1$ / ;
5
- const ESCAPE_REGEX = / \\ ( u [ 0 - 9 a - f ] { 4 } | x [ 0 - 9 a - f ] { 2 } | .) | ( [ ^ \\ ] ) / gi;
6
-
7
- const ESCAPES = {
8
- n : '\n' ,
9
- r : '\r' ,
10
- t : '\t' ,
11
- b : '\b' ,
12
- f : '\f' ,
13
- v : '\v' ,
14
- 0 : '\0' ,
15
- '\\' : '\\' ,
16
- e : '\u001b' ,
17
- a : '\u0007'
18
- } ;
5
+ const ESCAPE_REGEX = / \\ ( u [ a - f \d ] { 4 } | x [ a - f \d ] { 2 } | .) | ( [ ^ \\ ] ) / gi;
6
+
7
+ const ESCAPES = new Map ( [
8
+ [ 'n' , '\n' ] ,
9
+ [ 'r' , '\r' ] ,
10
+ [ 't' , '\t' ] ,
11
+ [ 'b' , '\b' ] ,
12
+ [ 'f' , '\f' ] ,
13
+ [ 'v' , '\v' ] ,
14
+ [ '0' , '\0' ] ,
15
+ [ '\\' , '\\' ] ,
16
+ [ 'e' , '\u001B' ] ,
17
+ [ 'a' , '\u0007' ]
18
+ ] ) ;
19
19
20
20
function unescape ( c ) {
21
21
if ( ( c [ 0 ] === 'u' && c . length === 5 ) || ( c [ 0 ] === 'x' && c . length === 3 ) ) {
22
22
return String . fromCharCode ( parseInt ( c . slice ( 1 ) , 16 ) ) ;
23
23
}
24
24
25
- return ESCAPES [ c ] || c ;
25
+ return ESCAPES . get ( c ) || c ;
26
26
}
27
27
28
28
function parseArguments ( name , args ) {
You can’t perform that action at this time.
0 commit comments