@@ -9,14 +9,14 @@ import { CONTROL_CHARACTERS } from "./CONTROL_CHARACTERS";
99 * @param {string } str
1010 * @return {string }
1111 */
12- const unicodeEscape = str => {
13- return str . replace ( / ./ g, c => {
12+ const unicodeEscape = ( str ) => {
13+ return str . replace ( / ./ g, ( c ) => {
1414 return `\\u${ `000${ c . charCodeAt ( 0 ) . toString ( 16 ) } ` . substr ( - 4 ) } ` ;
1515 } ) ;
1616} ;
1717
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 ) ;
2020 if ( ! matchChar ) {
2121 return "" ;
2222 }
@@ -37,19 +37,19 @@ const reporter = (context, options = {}) => {
3737 const allow = options . allow || DEFAULT_OPTION . allow ;
3838 const checkCode = options . checkCode !== undefined ? options . checkCode : DEFAULT_OPTION . checkCode ;
3939 const checkImage = options . checkImage !== undefined ? options . checkImage : DEFAULT_OPTION . checkImage ;
40- const checkNode = node => {
40+ const checkNode = ( node ) => {
4141 const text = getSource ( node ) ;
4242 // Ignore \r \n \t
4343 const controlCharacterPattern = / ( [ \x00 - \x08 \x0B \x0C \x0E - \x1F \x7F ] ) / g;
4444 /**
4545 * @type {Array<{match:string, sub:string[], index:number}> }
4646 */
4747 const results = execall ( controlCharacterPattern , text ) ;
48- results . forEach ( result => {
48+ results . forEach ( ( result ) => {
4949 const index = result . index ;
5050 const char = result . sub [ 0 ] ;
5151 // if allow the `char`, ignore it
52- if ( allow . some ( allowChar => allowChar === char ) ) {
52+ if ( allow . some ( ( allowChar ) => allowChar === char ) ) {
5353 return ;
5454 }
5555 const name = getName ( char ) ;
0 commit comments