logify
Version:
Logging framework for node and the browser
23 lines (20 loc) • 451 B
JavaScript
;
Object.defineProperty(exports, '__esModule', {
value: true
});
function detect() {
var visited = [];
return function (key, value) {
if (visited.indexOf(this[key]) !== -1) {
return '[Circular]';
}
if (visited.indexOf(this) === -1) {
visited.push(this);
}
return value;
};
}
exports['default'] = function (entry) {
return JSON.stringify(entry, detect());
};
module.exports = exports['default'];