Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Support a namedExports false option for dataToEsm - #32

Merged
lukastaegert merged 4 commits into
masterfrom
namedExports
May 21, 2018
Merged

Support a namedExports false option for dataToEsm#32
lukastaegert merged 4 commits into
masterfrom
namedExports

Conversation

@guybedford

Copy link
Copy Markdown
Contributor

This is useful for having a flag to entirely enable/disable named exports from data imports (currently named exports should be disabled for strict NodeJS compatibility with the work-in-progress implementation).

@lukastaegert lukastaegert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment, looks good!

Comment thread src/dataToEsm.js Outdated
const n = options.compact ? '' : '\n';
const declarationType = options.preferConst ? 'const' : 'var';

if (options.namedExports === false || typeof data !== 'object' || Array.isArray(data))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we actually allow for non-object types to be passed here, we should add a check for null as well.

@guybedford

Copy link
Copy Markdown
Contributor Author

Thanks @lukastaegert. Sure, I've pushed the update. Please also check the null PR here too.

@lukastaegert
lukastaegert merged commit eea7d7e into master May 21, 2018
@lukastaegert
lukastaegert deleted the namedExports branch May 21, 2018 17:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants