sneakertack/nvar

Prepending variables with export does not work.

Closed this issue · 2 comments

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

🤦‍♂️ @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.

Closing, fixed by v1.3.1.