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.

returns "true", "false" as string instead of boolean

See original GitHub issue

Since true and false are expected to be boolean values, negating and/or testing explicitly failes.

XML <a show="false"/>

to JSON

{
  "a": {
    "_attributes": {
      "show": "false"
    }
  }
}

Testing

if (!a._attributes.show) // this is will not end well

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
winniehellcommented, Jul 3, 2018

@nashwaan Thank you very much! ❤️ Especially for the fast response time.

0reactions
nashwaancommented, Jul 3, 2018

@winniehell thanks for your contribution. nativeTypeAttributes is now published in v1.6.5.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to return string instead of boolean in javascript
There are some errors like you use (return true/false) instead of string value return. Except in if (S.length === 0) { console.log(result ...
Read more >
Boolean.prototype.toString() - JavaScript - MDN Web Docs
For Boolean values, the toString method returns a string representation of the boolean value, which is either "true" or "false" .
Read more >
Return a String instead of true/false - Power Platform Community
If you want to change the boolean value from true to ''yes'' and false to ''no'' (change from Boolean to string).
Read more >
Java.lang.Boolean.toString() Method - Tutorialspoint
The java.lang.Boolean.toString(boolean b) returns a String object representing the specified boolean. If the specified boolean is true, then the string "true ...
Read more >
JavaScript String to Boolean – How to Parse a Boolean in JS
Note: When you convert a string of "false" , you'd expect it to return a boolean value of false . But this will...
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