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.

Perhaps it would be cool to include a proper .toString() method - I’ve found it quite useful when debugging in other packages. Right now it has the following behavior:

const bel = require('bel')
const tree = bel`<div>hello world</div>`
console.log(tree.toString())
// => <div></div>

Thanks!

Similar to https://github.com/shama/base-element/issues/5

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
yoshuawuytscommented, Mar 16, 2016

🎉

1reaction
chromakodecommented, Mar 15, 2016

Re: child node traversal, I noticed this afternoon that text nodes weren’t working and did some digging. The issue there is that bel expects text nodes to have a nodeName set, which in browsers is '#text', but in min-document this is currently unset.

I’ve opened a pull request on min-document to add this: https://github.com/Raynos/min-document/pull/37

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object.prototype.toString() - JavaScript - MDN Web Docs
The toString() method returns a string representing the object. This method is meant to be overridden by derived objects for custom type ...
Read more >
JavaScript String toString() Method - W3Schools
The toString() method returns a string as a string. The toString() method does not change the original string. The toString() method can be...
Read more >
How to use the toString() in Java - Educative.io
A toString() is an in-built method in Java that returns the value given to it in string format. Hence, any object that this...
Read more >
Understanding toString() method - Javatpoint
If you want to represent any object as a string, toString() method comes into existence. The toString() method returns the String representation of...
Read more >
JavaScript Number toString() Method - GeeksforGeeks
The JavaScript Number toString() Method in Javascript is used with a number and converts the number to a string.
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