-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Provide JS Modules export? #50
Comments
I'm generally not interested in having a transpile-step in my modules, but I've started appreciating TypeScript, which actually makes a compile-step worth it. So what I'm saying is that if anyone rewrites this module in TS, I'm willing to add a compile-step. Happy to use https://github.com/developit/microbundle for that. |
Hi! Can you suggest a better solution for this? |
I'm having doubts whether these makes sense as named imports. |
I think |
If they are going to be "named exports", I think it would make sense to make them named something like |
Your package already has type definitions which reflect the simple named import : I suggest keeping it that way, i.e. concise instead of verbose. I know everyone has a different opinion on this naming dilemna. Another point for me is don't fix what is not broken. Ask yourself : did somebody complain about the concise naming ? Finally, you already have some kind of "standard" on this matter : Lodash also exports a simple |
Just another perspective: I actually use the import { get } from 'dot-prop'
export default async ({ mediator, query, security }) => {
if (get(security, 'security/public-mobile-app')) {
query.state = 'published'
}
return {
status: 200,
body: {
data: await mediator.call('controller/players/find', { query })
}
}
} Coming from projects that use import { getProperty } from 'dot-prop'
export default async ({ mediator, query, security }) => {
if (getProperty(security, 'security/public-mobile-app')) { |
I'm going with this. |
Hi @sindresorhus!
This module is pretty popular, and its functionality is fairly segmented (get vs set). I'm willing to bet a decent number of people are only using this to safely retrieve the value at a dotted path (not set).
Given that assumption, I was wondering if you'd be open to providing a JS Modules version where
{ set, get }
are named exports? I'd be happy to open a PR, though I'd need to know what solution you'd prefer for transpiling modules to commonjs (I'm biased).Cheers!
The text was updated successfully, but these errors were encountered: