File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -30,17 +30,10 @@ export function dedent(
3030 strings : $ReadOnlyArray < string > ,
3131 ...values : $ReadOnlyArray < string >
3232) : string {
33- let str = '' ;
33+ let str = strings [ 0 ] ;
3434
35- for ( let i = 0 ; i < strings . length ; ++ i ) {
36- str += strings [ i ] ;
37- if ( i < values . length ) {
38- // istanbul ignore next (Ignore else inside Babel generated code)
39- const value = values [ i ] ;
40-
41- str += value ; // interpolation
42- }
35+ for ( let i = 1 ; i < strings . length ; ++ i ) {
36+ str += values [ i - 1 ] + strings [ i ] ; // interpolation
4337 }
44-
4538 return dedentString ( str ) ;
4639}
Original file line number Diff line number Diff line change 11import { expect } from 'chai' ;
22import { describe , it } from 'mocha' ;
33
4- import { dedent } from '../../__testUtils__/dedent' ;
4+ import { dedent , dedentString } from '../../__testUtils__/dedent' ;
55
66import { DirectiveLocation } from '../../language/directiveLocation' ;
77
@@ -158,7 +158,7 @@ describe('Type System Printer', () => {
158158
159159 expectPrintedSchema ( schema ) . to . equal (
160160 // $FlowFixMe[incompatible-call]
161- dedent ( String . raw `
161+ dedentString ( String . raw `
162162 type Query {
163163 singleField(argOne: String = "tes\t de\fault"): String
164164 }
You can’t perform that action at this time.
0 commit comments