nuxt-testevia
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "nuxt-testevia", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Nuxt - Testevia Logger", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
import axios from 'axios' | ||
const whichBrowser = () =>{ | ||
let test = (regexp) => regexp.test(window.navigator.userAgent); | ||
function whichBrowser(){ | ||
let test = function(regexp){return regexp.test(window.navigator.userAgent)}; | ||
switch(true){ | ||
@@ -17,3 +17,3 @@ case test(/edge/i): return "Edge"; | ||
export default { | ||
errorHandler(options){ | ||
errorHandler: function(options){ | ||
let self = this; | ||
@@ -26,3 +26,3 @@ return function errorHandlerMiddleware(err, req, res, next) { | ||
sendError(url, err, options){ | ||
sendError: function(url, err, options){ | ||
let context = { | ||
@@ -32,3 +32,3 @@ project: options.project, | ||
data: { | ||
url | ||
url: url | ||
}, | ||
@@ -50,3 +50,3 @@ } | ||
axios.post('https://testevia.broj42.com/api/log-errors/', context, {headers: {'Authorization': options.apiKey}}) | ||
.catch(e =>{ | ||
.catch(function(e){ | ||
console.dir(e) | ||
@@ -53,0 +53,0 @@ }); |
@@ -14,5 +14,5 @@ const path = require('path') | ||
this.nuxt.hook('render:errorMiddleware', app => app.use(errorHandler.errorHandler(options))) | ||
this.nuxt.hook('render:errorMiddleware', function(app){app.use(errorHandler.errorHandler(options))}) | ||
} | ||
module.exports.meta = require('../package.json') |
2952