Closed idleberg closed 8 years ago
JSON is valid CSON
Or is the issue more that it is not a string being passed in your code sample?
I use your package for an Atom plugin and since I don't want to rely on the scope alone (which Atom determines by file extension), I wanted to use parseCSONString
to test whether I'm working with CSON or JSON.
Well, as JSON is a subset of CSON, it means JSON is valid CSON, so using the parse CSON methods for testing JSON won't work, as JSON is valid CSON. However, CSON is not a subset of JSON, which means CSON is not valid CSON. Inverse your try catch and you'll be good.
OK, thanks!
I noticed that
parseCSONString
will accept passed JSONI'd expect this to throw an error, otherwise what would be the difference between
parseString
andparseCSONString
?