question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot get properties of complex type

See original GitHub issue

Describe the bug I have a complex type where i can pass some “selection” to a function and this function will return subset type: From https://stackoverflow.com/a/51968630/3021445

interface Data {
  one: string;
  two: number;
  three: {
    four: string;
    five: {
      six: Date;
    };
  };
}

declare const data: Data;

const result = select(data, { one: true, three: { five: { six: true } } }); 
// Here the "result" variable type will have all fields except "two" and "four"

I need to get "result" variable fields, but for some reason when i try to get type of "three" variable it becomes "any" type.

Version: 11.0.0

To Reproduce

I create codesandbox where you can play https://codesandbox.io/s/goofy-diffie-owje4?file=/src/utils.ts:1470-1527

Expected behavior

I am able to get correct type object for complex types

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dsherretcommented, Jun 7, 2021

@aspirisen sorry, I didn’t see the all the files in the code sandbox. I will take a look at this soon.

1reaction
aspirisencommented, Jun 7, 2021

@dsherret i have empty array

Read more comments on GitHub >

github_iconTop Results From Across the Web

Get complex type properties from PropertyInfo - Stack Overflow
I would like pass the complex property as parameter, but at this moment the property variable is a PropertyInfo and I need the...
Read more >
Complex Type properties - Breeze
Complex types do not have identities (key properties in breeze) and therefore cannot exist independently. Complex types can only exist as properties on ......
Read more >
Complex Types - EF Designer - EF6 - Microsoft Learn
Properties of a complex type can be scalar types or existing complex types. However, complex type properties cannot have circular references.
Read more >
Working with objects - JavaScript - MDN Web Docs - Mozilla
The same way, JavaScript objects can have properties, which define their ... Define the object type by writing a constructor function.
Read more >
Making Complex Types Useful with Entity Framework 6 ...
With a Complex Type, if you need to add an apartment number property to your address structure, you would just update the Complex...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found