UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

15 lines (14 loc) 320 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseJsonSafely = function (str, parseWith) { if (!parseWith) parseWith = JSON.parse; var result; try { result = parseWith(str); } catch (e) { result = undefined; } return result; };