- Notifications
You must be signed in to change notification settings - Fork1.9k
Do not use a promise polyfill on modern setups#815
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Do not use a promise polyfill on modern setups#815
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍
274a84e
to791292a
Compareif(valueinstanceofDate){ | ||
if(dateFormat){ | ||
dateUTC ?moment.utc(value).format(dateFormat) :moment(value).format(dateFormat); | ||
returndateUTC ?moment.utc(value).format(dateFormat) :moment(value).format(dateFormat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm pretty sure the missing return here was a bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
To make the most of async/await (performance & stack traces), we need to use the native Promises. This PR does not change that the default export uses
promish
, but it does add two new exports that allow access to the modern codebase and native promises. I've also fixed a couple of eslint failures in the affected files.