tsoid
Version:
Typed functional library to deal with async operations.
13 lines (12 loc) • 379 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function withLog(fn) {
return function loggerFn(...args) {
const { name } = fn;
const result = fn(...args);
// eslint-disable-next-line no-console
console.log(`${name || 'anonymous'}(${args}) = ${result}`);
return result;
};
}
exports.default = withLog;