Different Array<T> and Promise<T> types getting assigned the same metadata store id
See original GitHub issueI ran into an issue with using getType on arrays and promises.
const x = getType<string[]>().getTypeArguments()[0]; // returns string
const y = getType<number[]>().getTypeArguments()[0] // also returns string
I cloned the library and ran in debug mode inside the test suite:
I think the problem is that string[]
and number[]
are getting assigned the same metadata store id.
Let me know if I can help in any way, maybe this is already fixed in the update you are working on.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
typescript - How to unwrap the type of a Promise?
Let's get the parameters of that function. Parameters<Promise<string>['then']>[0] the first parameter of then : its callback.
Read more >Observables compared to other techniques - Angular
Promises provide one. This makes observables useful for getting multiple values over time. Observables differentiate between chaining and subscription.
Read more >Meta programming - JavaScript - MDN Web Docs
Proxy objects allow you to intercept certain operations and to implement custom behaviors. For example, getting a property on an object: const ...
Read more >Array - Sanity.io
When adding data with type: 'object' to an array, each item gets assigned a persistent and unique _key property. This is to ensure...
Read more >How to Deep Copy Objects and Arrays in JavaScript
Shallow copy using .assign(). 3.The same type of shallow copy would be created using Object.assign() , which can be used with any object...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Awesome, looks like the issue is fixed for me!
Solved.
I’ve published
tst-reflect-transformer@0.9.5
.