Skip to content

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Jan 6, 2020

This adds typed overloads to __assign, along with a TSDoc comment copied from lib.es2015.core.d.ts#ObjectConstructor.assign(…).


review?(@DanielRosenwasser)

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jan 15, 2020

Is there any particular reason you're looking to type these more strictly?

@ExE-Boss
Copy link
Contributor Author

Well, I’d like to eventually add type information to all TSLib helpers.

@DanielRosenwasser
Copy link
Member

But is there a benefit? This code generally doesn't get consumed by users, and specifically this function has a hard time being accurately typed.

@ExE-Boss
Copy link
Contributor Author

ExE-Boss commented Jan 15, 2020

Well, this function acts as an alias for Object.assign if it exists, and uses an approximate implementation if it doesn’t, like in an ES3 environment, which is why I just copied the type information from that.

Arguably, it should be defined as:

export declare var __assign: typeof Object.assign;

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.

2 participants