UNPKG

inceptum

Version:

hipages take on the foundational library for enterprise-grade apps written in NodeJS

39 lines 963 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); let NEWRELIC_AVAILABLE = false; let NEWRELIC = null; try { if (require.resolve('newrelic')) { NEWRELIC_AVAILABLE = true; // tslint:disable-next-line:no-var-requires NEWRELIC = require('newrelic'); } // tslint:disable-next-line:no-empty } catch (e) { } class NewrelicUtil { static isNewrelicAvailable() { return NEWRELIC_AVAILABLE; } static getNewrelicIfAvailable() { if (NEWRELIC_AVAILABLE) { return NEWRELIC; } else { return undefined; } } static mockUtil_setNewrelic(newrelic) { if (newrelic) { NEWRELIC_AVAILABLE = true; NEWRELIC = newrelic; } else { NEWRELIC_AVAILABLE = false; NEWRELIC = null; } } } exports.NewrelicUtil = NewrelicUtil; //# sourceMappingURL=NewrelicUtil.js.map