File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ function parseEnvLine(line: string): [string, string] {
114
114
// https://github.com/motdotla/dotenv/blob/master/lib/main.js#L32
115
115
// We don't use dotenv here because it loses ordering, which is
116
116
// 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 * $ / ) ;
118
118
if ( ! match ) {
119
119
return [ '' , '' ] ;
120
120
}
Original file line number Diff line number Diff line change @@ -395,23 +395,24 @@ Path=/usr/x:/usr/y
395
395
SPAM=1234
396
396
ham=5678
397
397
Eggs=9012
398
- _bogus1=...
399
398
1bogus2=...
400
399
bogus 3=...
401
400
bogus.4=...
402
401
bogus-5=...
403
402
bogus~6=...
404
403
VAR1=3456
405
404
VAR_2=7890
405
+ _VAR_3=1234
406
406
` ) ;
407
407
408
408
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' ) ;
410
410
expect ( vars ) . to . have . property ( 'SPAM' , '1234' , 'value is invalid' ) ;
411
411
expect ( vars ) . to . have . property ( 'ham' , '5678' , 'value is invalid' ) ;
412
412
expect ( vars ) . to . have . property ( 'Eggs' , '9012' , 'value is invalid' ) ;
413
413
expect ( vars ) . to . have . property ( 'VAR1' , '3456' , 'value is invalid' ) ;
414
414
expect ( vars ) . to . have . property ( 'VAR_2' , '7890' , 'value is invalid' ) ;
415
+ expect ( vars ) . to . have . property ( '_VAR_3' , '1234' , 'value is invalid' ) ;
415
416
} ) ;
416
417
417
418
test ( 'Empty values become empty string' , ( ) => {
You can’t perform that action at this time.
0 commit comments