• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: How do I convert a type but replacing every value in the type

Resolved: How do I convert a type but replacing every value in the type

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Just a new developer entering the typescript world. This may kinda seem not that all hard but I can’t seem to find any solutions about this issue from google nor stack overflow itsself.
How do I convert/cast typescript type from
to
I tried few possible solutions but all didn’t seem to work.

Answer:

Here’s how you do that. You take all the keys of the first type and create a Record type with a new value type ({public: true, private: true}).

If you have better answer, please add a comment about this, thank you!

casting javascript types typescript
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How can I copy files using the ansible.builtin.copy module and avoid conflicting file names?

26/03/2023

Resolved: Reshape tensors of unknown shape with tf.function

26/03/2023

Resolved: Use Svelte Component as Slot

26/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.