forgeplus-react/node_modules/happypack/lib/SourceMapSerializer.js

20 lines
313 B
JavaScript

exports.serialize = function(x) {
if (typeof x === 'string') {
return x;
}
else {
return JSON.stringify(x || null);
}
};
exports.deserialize = function(x) {
if (typeof x === 'string') {
try {
return JSON.parse(x);
} catch (e) {
return null;
}
}
return x || null;
};