UNPKG

@beenotung/tslib

Version:
20 lines (19 loc) 564 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.muteObject = muteObject; const noop = () => { return noop; }; // e.g. to mute cli-progress (progress bar) function muteObject(target) { let prototype = target; while (prototype !== null) { for (const name of Object.getOwnPropertyNames(prototype)) { const value = target[name]; if (typeof value === 'function') { target[name] = noop; } } prototype = Object.getPrototypeOf(prototype); } }