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.

Why does the type gets omitted?

See original GitHub issue

Not sure why the type is not being converted along with the rest of the properties. The problem is that I can’t get the type from within the entity.

For example I have a collection of polymorphic relationships drinks. And it can be coffee, tea, milk, etc. Processing a single drink as it is I don’t know its type, because the current implementation assumes that I already know the type either from the relationship or from elsewhere.

So the input would look like this:

{
  "drinks": [
    {
      "id": "1",
      "type": "coffee"
    },
    {
      "id": "5",
      "type": "tea"
    },
    {
      "id": "4",
      "type": "milk"
    }
  ]
}

And here’s the desired output:

"coffee": {
  "1": {
    "id": "1",
    "type": "coffee"
  },
},
"milk": {
  "4": {
    "id": "4",
    "type": "milk"
  },
},
"tea": {
  "5": {
    "id": "5",
    "type": "tea"
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
yury-dymovcommented, Feb 14, 2018

Thank you. Published update to npm

1reaction
antonkomarevcommented, Feb 14, 2018

Thank you for a such quick response!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Omitted-variable bias - Wikipedia
In statistics, omitted-variable bias (OVB) occurs when a statistical model leaves out one or more relevant variables. The bias results in the model...
Read more >
Why I can't omit properties from already omitted type?
It looks like it works if I change the OmitB type to: type OmitB<T extends B> = Omit<OmitA<T & B>, ...
Read more >
How to stop letters being deleted while you're typing
Solution: click Insert. It's annoying, and not to mention confusing when you type amendments only to see the next letter disappear, but the...
Read more >
Some characters missing or cut off when displayed on screen ...
When you view your document in Microsoft Word, some characters may be missing, or the top (or bottom) of some characters may be...
Read more >
What Is Omitted Variable Bias? | Definition & Examples - Scribbr
Omitted variable bias occurs when a statistical model fails to include one or more relevant variables.
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