Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepending variables with export does not work. #4

Closed
einnjo opened this issue Apr 26, 2018 · 2 comments
Closed

Prepending variables with export does not work. #4

einnjo opened this issue Apr 26, 2018 · 2 comments

Comments

@einnjo
Copy link

einnjo commented Apr 26, 2018

Node version: 8.10
Nvar version: 1.3.0

Assume this index.js for the following test cases:

// index.js
const config = {};
require('nvar')({ target: config });
console.log(config);

Expected output for all of the following cases:

{  foo: 'bar', hello: 'world' }

No export:

Given:

#.env
foo=bar
hello=world

Received:

{  foo: 'bar', hello: 'world' } // SUCCESS

Export:

Given:

# .env
export foo=bar
export hello=world

Received:

{ foo: 'bar' } // FAIL
@sneakertack
Copy link
Owner

🤦‍♂️ @juanjoLenero you are right, can't believe that this slipped through. All the tests so far were done using singular export statements, but the library would fail from the 2nd export statement onwards.

I've fixed it (6f9610e) and published as v1.3.1 - try it now. Thanks for taking the time to report the issue (solid reproduction steps), and apologies for the inconvenience caused.

@sneakertack
Copy link
Owner

Closing, fixed by v1.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants