@hirosystems/api-toolkit
Version:
API development toolkit
15 lines • 653 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDebugging = isDebugging;
/*
* Reliable way to check if we are debugging. Supports ts-node and other tools unlike some other
* approaches that check argv or env vars. It also lazy-loads the `node:inspector` module to avoid
* unnecessary overhead in production environments where this function might not be called.
*/
function isDebugging() {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const inspector = require('node:inspector');
const url = inspector.url();
return url !== undefined;
}
//# sourceMappingURL=is-debugging.js.map