Code coverage report for sockjs-client/lib/safe-json-parse.js

Statements: 100% (5 / 5)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (5 / 5)      Ignored: none     

All files » sockjs-client/lib/ » safe-json-parse.js
1 2 3 4 5 6 7 8 9 10 11 12 13    1   1 85 85     1      
'use strict';
 
module.exports = parse;
 
function parse(json, reviver) {
    try {
        return JSON.parse(json, reviver);
    }
    catch (e) {
        return null; // i hope it's ok to trade out some correctness here!  It's worked for PHP all these years :)
    }
}