@helsenorge/core-utils
Advanced tools
Comparing version 26.0.0 to 26.0.1
@@ -1,2 +0,8 @@ | ||
import { log } from './logger'; | ||
const allowConsoleOutput = () => { var _a; return !['production', 'test'].includes((_a = process.env.NODE_ENV) !== null && _a !== void 0 ? _a : ''); }; | ||
const log = (message, ...optionalParams) => { | ||
if (!allowConsoleOutput()) | ||
return; | ||
// eslint-disable-next-line no-console | ||
console.log(message, optionalParams); | ||
}; | ||
/** | ||
@@ -14,3 +20,3 @@ * Returnerer document.activeElement (element in focus), uavhengig av om den er i document-dom rllrt shadow-dom | ||
catch (e) { | ||
const logger = logCallback || log; | ||
const logger = logCallback !== null && logCallback !== void 0 ? logCallback : log; | ||
logger('Feil ved å ta tak i active element basert på angitt node: ', element, e); | ||
@@ -17,0 +23,0 @@ return null; |
{ | ||
"name": "@helsenorge/core-utils", | ||
"author": "Helsenorge", | ||
"version": "26.0.0", | ||
"version": "26.0.1", | ||
"main": "./index.js", | ||
@@ -6,0 +6,0 @@ "license": "ISC", |
Sorry, the diff of this file is not supported yet
97277
77
2199