Skip to content

refactor: use union type in DateConstructor#21757

Merged
mhegazy merged 2 commits into
microsoft:masterfrom
alan-agius4:patch-1
Feb 8, 2018
Merged

refactor: use union type in DateConstructor#21757
mhegazy merged 2 commits into
microsoft:masterfrom
alan-agius4:patch-1

Conversation

@alan-agius4
Copy link
Copy Markdown
Contributor

@alan-agius4 alan-agius4 commented Feb 8, 2018

Add support for union types in DateConstructor

This will add support for something like the below;
let date; string | number; const date = new Date(x);

Fixes #21758
Fixes #20900

@alan-agius4 alan-agius4 changed the title feat: use union type in DateConstructor refactor: use union type in DateConstructor Feb 8, 2018
Add support for union types in `DateConstructor`

This will add support for something like the below;
`
let date; string | number;
const date = new Date(x);
`

Closes: microsoft#21758
@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Feb 8, 2018

We need another overload as well in src\lib\es2015.core.d.ts to handle number | string | Date, see #20900 (comment) for more context.

@alan-agius4
Copy link
Copy Markdown
Contributor Author

Pushed an update

@mhegazy mhegazy merged commit 7b9ceb8 into microsoft:master Feb 8, 2018
@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented Feb 8, 2018

thanks!

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