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.

Empty objects shouldn't be split out

See original GitHub issue
this.__mockMetaDataCache[modulePath] = (this._moduleMocker.getMetadata({}): any);

outputs

this.__mockMetaDataCache[modulePath] = (this._moduleMocker.getMetadata({
}): any);

but should

this.__mockMetaDataCache[modulePath] = (this._moduleMocker.getMetadata(
  {}
): any);

https://prettier.github.io/prettier/#{"content"%3A"this.__mockMetaDataCache[modulePath] %3D (this._moduleMocker.getMetadata({})%3A any)%3B%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3Afalse%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22doc%22%3Afalse%7D%7D

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
jlongstercommented, Feb 24, 2017

I ran into this code today which breaks similarly:

      navigation = this._childNavigationProps[
        scene.key
      ] = addNavigationHelpers({
        ...this.props.navigation,
        state: scene.route
      });

whereas somethings like this looks better (although I’m not really sure of the best way to format it):

      navigation = this._childNavigationProps[scene.key] =
        addNavigationHelpers({
          ...this.props.navigation,
          state: scene.route
        });

Not a huge deal, just though I’d bring up that we break on the brackets in these kinds of assignments expressions which feels a little weird.

0reactions
vjeuxcommented, May 21, 2017

They are not split out anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Why are empty strings returned in split() results?
1. I have the same question and searched it for a long time. · 7. A solution is to use strip() to strip...
Read more >
String.split option to ignore empty parts? - Google Groups
Basically String.split works great if your data is 'A,B,C' and you do .split(','), but it doesn't behave as desired if your data is...
Read more >
The ability to represent empty objects #568 - GitHub
Based on this: graphql/graphql-js#937 (comment) Currently we can't represent an empty object type: type Mutation { createUser(email: String!
Read more >
Change object should not be null? - Mendix Forum
Hi community, I am facing an error when I click a button that triggers a microflow: Change object 'FinancialResult' should not be null...
Read more >
Use empty string, null or remove empty property in API request ...
The JSON that you receive is not an object and should not be treated as such. It's just structured data which may (or...
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