core-mvc
Version:
Simple but powerful MVC framework for NodeJS.
23 lines (22 loc) • 689 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.log = exports.createCircularReplacer = void 0;
/* eslint-disable consistent-return */
const createCircularReplacer = () => {
const seen = new WeakSet();
return (key, value) => {
if (typeof value === 'object' && value !== null) {
if (seen.has(value)) {
return;
}
seen.add(value);
}
return value;
};
};
exports.createCircularReplacer = createCircularReplacer;
/* eslint-disable no-console */
const log = (event) => {
console.log(JSON.stringify(event, (0, exports.createCircularReplacer)()));
};
exports.log = log;