File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 44
55'use strict' ;
66
7+ const arrayIncludes = require ( 'array-includes' ) ;
8+
79const pragmaUtil = require ( '../util/pragma' ) ;
810const jsxUtil = require ( '../util/jsx' ) ;
911const docsUrl = require ( '../util/docsUrl' ) ;
@@ -47,8 +49,8 @@ function trimLikeReact(text) {
4749 const leadingSpaces = / ^ \s * / . exec ( text ) [ 0 ] ;
4850 const trailingSpaces = / \s * $ / . exec ( text ) [ 0 ] ;
4951
50- const start = leadingSpaces . includes ( '\n' ) ? leadingSpaces . length : 0 ;
51- const end = trailingSpaces . includes ( '\n' ) ? text . length - trailingSpaces . length : text . length ;
52+ const start = arrayIncludes ( leadingSpaces , '\n' ) ? leadingSpaces . length : 0 ;
53+ const end = arrayIncludes ( trailingSpaces , '\n' ) ? text . length - trailingSpaces . length : text . length ;
5254
5355 return text . slice ( start , end ) ;
5456}
@@ -92,7 +94,7 @@ module.exports = {
9294 function isPaddingSpaces ( node ) {
9395 return isJSXText ( node ) &&
9496 isOnlyWhitespace ( node . raw ) &&
95- node . raw . includes ( '\n' ) ;
97+ arrayIncludes ( node . raw , '\n' ) ;
9698 }
9799
98100 /**
You can’t perform that action at this time.
0 commit comments