@airbrake/node
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -5,3 +5,4 @@ "use strict"; | ||
return function airbrakeMiddleware(req, res, next) { | ||
var route = req.route ? req.route.path : 'UNKNOWN'; | ||
var _a, _b, _c; | ||
var route = (_c = (_b = (_a = req.route) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'UNKNOWN'; | ||
var metric = airbrake.routes.start(req.method, route); | ||
@@ -14,3 +15,4 @@ if (!metric.isRecording()) { | ||
res.end = function abEnd() { | ||
metric.route = req.route ? req.route.path : 'UNKNOWN'; | ||
var _a, _b, _c; | ||
metric.route = (_c = (_b = (_a = req.route) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'UNKNOWN'; | ||
metric.statusCode = res.statusCode; | ||
@@ -39,3 +41,5 @@ metric.contentType = res.get('Content-Type'); | ||
if (req.route) { | ||
notice.context.route = req.route.path; | ||
if (req.route.path) { | ||
notice.context.route = req.route.path.toString(); | ||
} | ||
if (req.route.stack && req.route.stack.length) { | ||
@@ -42,0 +46,0 @@ notice.context.action = req.route.stack[0].name; |
export declare const NOTIFIER_NAME = "airbrake-js/node"; | ||
export declare const NOTIFIER_VERSION = "1.1.0"; | ||
export declare const NOTIFIER_VERSION = "1.1.1"; | ||
export declare const NOTIFIER_URL = "https://github.com/airbrake/airbrake-js/tree/master/packages/node"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NOTIFIER_NAME = 'airbrake-js/node'; | ||
exports.NOTIFIER_VERSION = '1.1.0'; | ||
exports.NOTIFIER_VERSION = '1.1.1'; | ||
exports.NOTIFIER_URL = 'https://github.com/airbrake/airbrake-js/tree/master/packages/node'; | ||
//# sourceMappingURL=version.js.map |
export function makeMiddleware(airbrake) { | ||
return function airbrakeMiddleware(req, res, next) { | ||
var route = req.route ? req.route.path : 'UNKNOWN'; | ||
var _a, _b, _c; | ||
var route = (_c = (_b = (_a = req.route) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'UNKNOWN'; | ||
var metric = airbrake.routes.start(req.method, route); | ||
@@ -11,3 +12,4 @@ if (!metric.isRecording()) { | ||
res.end = function abEnd() { | ||
metric.route = req.route ? req.route.path : 'UNKNOWN'; | ||
var _a, _b, _c; | ||
metric.route = (_c = (_b = (_a = req.route) === null || _a === void 0 ? void 0 : _a.path) === null || _b === void 0 ? void 0 : _b.toString()) !== null && _c !== void 0 ? _c : 'UNKNOWN'; | ||
metric.statusCode = res.statusCode; | ||
@@ -35,3 +37,5 @@ metric.contentType = res.get('Content-Type'); | ||
if (req.route) { | ||
notice.context.route = req.route.path; | ||
if (req.route.path) { | ||
notice.context.route = req.route.path.toString(); | ||
} | ||
if (req.route.stack && req.route.stack.length) { | ||
@@ -38,0 +42,0 @@ notice.context.action = req.route.stack[0].name; |
export declare const NOTIFIER_NAME = "airbrake-js/node"; | ||
export declare const NOTIFIER_VERSION = "1.1.0"; | ||
export declare const NOTIFIER_VERSION = "1.1.1"; | ||
export declare const NOTIFIER_URL = "https://github.com/airbrake/airbrake-js/tree/master/packages/node"; |
export var NOTIFIER_NAME = 'airbrake-js/node'; | ||
export var NOTIFIER_VERSION = '1.1.0'; | ||
export var NOTIFIER_VERSION = '1.1.1'; | ||
export var NOTIFIER_URL = 'https://github.com/airbrake/airbrake-js/tree/master/packages/node'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@airbrake/node", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Official Airbrake notifier for Node.js", | ||
@@ -20,3 +20,3 @@ "author": "Airbrake", | ||
"dependencies": { | ||
"@airbrake/browser": "^1.1.0", | ||
"@airbrake/browser": "^1.1.1", | ||
"cross-fetch": "^3.0.4", | ||
@@ -48,4 +48,7 @@ "error-stack-parser": "^2.0.4", | ||
"build": "yarn build:cjs && yarn build:esm", | ||
"build:watch": "concurrently 'yarn build:cjs:watch' 'yarn build:esm:watch'", | ||
"build:cjs": "tsc -p tsconfig.json", | ||
"build:cjs:watch": "tsc -p tsconfig.json -w --preserveWatchOutput", | ||
"build:esm": "tsc -p tsconfig.esm.json", | ||
"build:esm:watch": "tsc -p tsconfig.esm.json -w --preserveWatchOutput", | ||
"clean": "rm -rf dist esm", | ||
@@ -52,0 +55,0 @@ "lint": "tslint -p .", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
95347
1327
Updated@airbrake/browser@^1.1.1