Skip to content
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

TypeScript Splits the Atom! #10

Open
danvk opened this issue Mar 1, 2022 · 6 comments
Open

TypeScript Splits the Atom! #10

danvk opened this issue Mar 1, 2022 · 6 comments
Labels
💬 blog comments Comments on effectivetypescript.com (Utterances)

Comments

@danvk
Copy link
Owner

danvk commented Mar 1, 2022

TypeScript Splits the Atom!

https://effectivetypescript.com/2020/11/05/template-literal-types/

@danvk danvk added the 💬 blog comments Comments on effectivetypescript.com (Utterances) label Mar 1, 2022
@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by Bob on 2020-11-22 12:53:

Where does Capitalize come from?

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by danvdk on 2020-11-22 01:50:

It's one of four new built-in generics in TS 4.1: Uppercase, Lowercase, Capitalize and Uncapitalize. Take a look at the TypeScript 4.1 release post.

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by Pomar81 (pomar81) on 2020-11-22 06:51:

Unfortunately type OnString = `on${string}` gives an error in playgroud

https://www.typescriptlang....

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by danvdk on 2020-11-22 07:17:

You're on the 4.1 beta for the playground. Try it on the 4.1 release (4.1.2) or a nightly, it'll work: https://www.typescriptlang....

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by Pomar81 (pomar81) on 2020-11-23 05:13:

it will be great if we can type something like
type WithData = {[key: `data-${string}`]: string}

@danvk
Copy link
Owner Author

danvk commented Mar 1, 2022

Comment by Tomás Fox (tom_s_fox) on 2021-09-02 01:51:

This is now possible in 4.4: https://devblogs.microsoft....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 blog comments Comments on effectivetypescript.com (Utterances)
Projects
None yet
Development

No branches or pull requests

1 participant