While working on axe-core, an accessibility testing library, we ran into an interesting problem. We needed to be able to detect when a string of text had been replaced by a ligature icon.
Sometimes it’s helpful to be able to read data that could be either JSON or text and parse it as such.
For example, all data in LocalStorage is saved as a string. This means saving the boolean true will be saved as the string…