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.

encode function encodes 0 to empty string

See original GitHub issue

Code to reproduce:

import { encode } from 'html-entities'
console.log(encode(0))

running

import { encode } from 'html-entities'
console.log(typeof(encode(0))

gives console output string running

import { encode } from 'html-entities'
console.log(encode(0).length)

gives console output 0

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
mdevilscommented, Feb 21, 2022

@guptadeepanshu21 Try writing

console.log(require('html-entities/package.json').version);

to know what exact version you have installed right now.

0reactions
guptadeepanshu21commented, Feb 21, 2022

@mdevils you are correct, somehow webpack-dev-server is not getting the latest version. I will try to debug it. Anyway, Thank you for helping.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to encode/decode a empty string - Stack Overflow
In my code i use a errormessage (string) to report any problems, this errormessage is most of the time empty. If i encode...
Read more >
Bug. Decoding 0x80 / Encoding and decoding of 0 #28 - GitHub
The rlp encoding of 0 is 0x80. decoding 0x80 should return 0x0. The source returns an empty buffer which is incorrect.
Read more >
Balanced Zero-One Encoding - string
Encode a string that entirely consists of uppercase alphabets ( A-Z ) using only zeros and ones, using your own favorite scheme. But...
Read more >
MySQL | ENCODE( ) Function - GeeksforGeeks
The MySQL DECODE() function returns empty strings if the string passed is an empty string.
Read more >
encodeURI() - JavaScript - MDN Web Docs
The encodeURI() function escapes characters by UTF-8 code units, with each octet encoded in the format %XX , left-padded with 0 if necessary....
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