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

Export functions individually #47

Closed
wants to merge 1 commit into from
Closed

Export functions individually #47

wants to merge 1 commit into from

Conversation

voxpelli
Copy link

This enables one to do:

import { getMessage } from 'check-error';

Previous code required:

import checkError from 'check-error';
const { getMessage } = checkError;

This enables one to do:

```js
import { getMessage } from 'check-error';
```

Previous code required:

```js
import checkError from 'check-error';
const { getMessage } = checkError;
```
@keithamus
Copy link
Member

@koddsson would you like to land this one?

@voxpelli
Copy link
Author

Do btw note that this would be a breaking change, requiring to be released as eg 3.0.0

@keithamus
Copy link
Member

We could always keep both and not break 😃

@@ -121,5 +121,3 @@ function getMessage(errorLike) {

return msg;
}

export { compatibleInstance, compatibleConstructor, compatibleMessage, getMessage, getConstructorName };
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, what do you think about keeping this, and we can release this as 3.0.1?

@voxpelli
Copy link
Author

Never mind this PR, one shouldn't do PR:s at late Friday evenings evidently.

I mixed up export { ... }; with export default { ... };, the latter matching the behavior of a CJS module whereas the former matches individual exports.

So: My PR is functionally identical to the existing code and as such a simple case of code formatting preference and as such a rather needless one.

@voxpelli voxpelli closed this Jul 22, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants