@@ -9,14 +9,14 @@ import { CONTROL_CHARACTERS } from "./CONTROL_CHARACTERS";
9
9
* @param {string } str
10
10
* @return {string }
11
11
*/
12
- const unicodeEscape = str => {
13
- return str . replace ( / ./ g, c => {
12
+ const unicodeEscape = ( str ) => {
13
+ return str . replace ( / ./ g, ( c ) => {
14
14
return `\\u${ `000${ c . charCodeAt ( 0 ) . toString ( 16 ) } ` . substr ( - 4 ) } ` ;
15
15
} ) ;
16
16
} ;
17
17
18
- const getName = char => {
19
- const matchChar = CONTROL_CHARACTERS . find ( CONTROL_CHARACTER => CONTROL_CHARACTER . code === char ) ;
18
+ const getName = ( char ) => {
19
+ const matchChar = CONTROL_CHARACTERS . find ( ( CONTROL_CHARACTER ) => CONTROL_CHARACTER . code === char ) ;
20
20
if ( ! matchChar ) {
21
21
return "" ;
22
22
}
@@ -37,19 +37,19 @@ const reporter = (context, options = {}) => {
37
37
const allow = options . allow || DEFAULT_OPTION . allow ;
38
38
const checkCode = options . checkCode !== undefined ? options . checkCode : DEFAULT_OPTION . checkCode ;
39
39
const checkImage = options . checkImage !== undefined ? options . checkImage : DEFAULT_OPTION . checkImage ;
40
- const checkNode = node => {
40
+ const checkNode = ( node ) => {
41
41
const text = getSource ( node ) ;
42
42
// Ignore \r \n \t
43
43
const controlCharacterPattern = / ( [ \x00 - \x08 \x0B \x0C \x0E - \x1F \x7F ] ) / g;
44
44
/**
45
45
* @type {Array<{match:string, sub:string[], index:number}> }
46
46
*/
47
47
const results = execall ( controlCharacterPattern , text ) ;
48
- results . forEach ( result => {
48
+ results . forEach ( ( result ) => {
49
49
const index = result . index ;
50
50
const char = result . sub [ 0 ] ;
51
51
// if allow the `char`, ignore it
52
- if ( allow . some ( allowChar => allowChar === char ) ) {
52
+ if ( allow . some ( ( allowChar ) => allowChar === char ) ) {
53
53
return ;
54
54
}
55
55
const name = getName ( char ) ;
0 commit comments