Closed zhaotoday closed 8 years ago
yes, your input is not a valid json
instead of '{"a":"{\"b\":1}"}'
it should be '{"a":{\"b\":1}}'
( and you don't need to escape "
inside '
s, so this is ok, too:
const obj = '{"a":{"b":1}}';
console.log(JSON.parse(obj))
import JSON from 'json-bigint';
const json = JSON({ strict: false, storeAsString: true });
const obj = '{"a":"{\"b\":1}"}'; // it works well when: const obj = '{"a":"{\"b\":1}"}'; json.parse(obj);
Why there must be double \?