-
Notifications
You must be signed in to change notification settings - Fork 176
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
Updated mongoose timestamp #206
Conversation
For CommonJS |
Updated mongoose timestamp
This need to be part of the writing guideline. 😄 |
@blakeembrey no |
@Fank , yeah, but that is a hint and "generally" it is fine for application engineer. But it does not work well for typings author. I'm created an issue on TypeScript about this: microsoft/TypeScript#7398 |
@unional Thanks for the info, yea writing typings for such a syntax is pain in the *** |
@Fank The problem is there is no ES6-style imports that interop with Node's CommonJS-style |
Actually that is not completely accurate. That's what the The problem remain is
|
And, as mentioned in that issue, the critical problem with this interop is that it is not captured in the resulting So it is subject to the consumer's configuration and it is bounded to cause grief.
Yeah, this was probably the FIRST question I bug Blake. 😜 |
@unional It shouldn't be captured in the On the The
That said, the definition should always be correct according to the source and ideally we leave fixing these hacks to TypeScript instead of introducing the hacks ourselves which really makes things harder to evolve later. |
100% agrees that we should leave these hacks to TS That's why I should include this into the style guide. About capturing, for the sake of discussion, it capturing the intent. Say the package author wrote |
I updated the code to use
import
instead ofrequire
before the only way to import it:
and now import is also possible
Typings URL: https://github.com/Fankserver/npm-mongoose-timestamp
Source URL: https://github.com/drudge/mongoose-timestamp
Was the way i changed the code right?
Is there a other way to use import?