File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ function parseEnvLine(line: string): [string, string] {
114114 // https://github.com/motdotla/dotenv/blob/master/lib/main.js#L32
115115 // We don't use dotenv here because it loses ordering, which is
116116 // significant for substitution.
117- const match = line . match ( / ^ \s * ( [ a - z A - Z ] \w * ) \s * = \s * ( .* ?) ? \s * $ / ) ;
117+ const match = line . match ( / ^ \s * ( _ * [ a - z A - Z ] \w * ) \s * = \s * ( .* ?) ? \s * $ / ) ;
118118 if ( ! match ) {
119119 return [ '' , '' ] ;
120120 }
Original file line number Diff line number Diff line change @@ -395,23 +395,24 @@ Path=/usr/x:/usr/y
395395SPAM=1234
396396ham=5678
397397Eggs=9012
398- _bogus1=...
3993981bogus2=...
400399bogus 3=...
401400bogus.4=...
402401bogus-5=...
403402bogus~6=...
404403VAR1=3456
405404VAR_2=7890
405+ _VAR_3=1234
406406 ` ) ;
407407
408408 expect ( vars ) . to . not . equal ( undefined , 'Variables is undefiend' ) ;
409- expect ( Object . keys ( vars ! ) ) . lengthOf ( 5 , 'Incorrect number of variables' ) ;
409+ expect ( Object . keys ( vars ! ) ) . lengthOf ( 6 , 'Incorrect number of variables' ) ;
410410 expect ( vars ) . to . have . property ( 'SPAM' , '1234' , 'value is invalid' ) ;
411411 expect ( vars ) . to . have . property ( 'ham' , '5678' , 'value is invalid' ) ;
412412 expect ( vars ) . to . have . property ( 'Eggs' , '9012' , 'value is invalid' ) ;
413413 expect ( vars ) . to . have . property ( 'VAR1' , '3456' , 'value is invalid' ) ;
414414 expect ( vars ) . to . have . property ( 'VAR_2' , '7890' , 'value is invalid' ) ;
415+ expect ( vars ) . to . have . property ( '_VAR_3' , '1234' , 'value is invalid' ) ;
415416 } ) ;
416417
417418 test ( 'Empty values become empty string' , ( ) => {
You can’t perform that action at this time.
0 commit comments