Comparing version 1.0.1 to 1.0.2
@@ -9,2 +9,3 @@ "use strict"; | ||
exports.runWithMdc = runWithMdc; | ||
exports.extractMdc = extractMdc; | ||
exports.patchConsole = patchConsole; | ||
@@ -50,2 +51,23 @@ | ||
}); | ||
} // unfortunately cls-hooked exposes these internal porperties and we must not modify them | ||
const nsInternalProps = ['_ns_name', 'id']; | ||
function extractMdc() { | ||
const { | ||
active | ||
} = namespace; | ||
if (!active) { | ||
return undefined; | ||
} | ||
const clone = JSON.parse(JSON.stringify(active)); // eslint-disable-next-line no-restricted-syntax | ||
for (const internalProp of nsInternalProps) { | ||
delete clone[internalProp]; | ||
} | ||
return clone; | ||
} | ||
@@ -52,0 +74,0 @@ |
{ | ||
"name": "@axah/log", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "lib/index.js", | ||
@@ -30,3 +30,3 @@ "license": "UNLICENSED", | ||
"eslint-plugin-import": "^2.15.0", | ||
"flow-bin": "^0.91.0", | ||
"flow-bin": "0.95.1", | ||
"flow-copy-source": "^2.0.2", | ||
@@ -33,0 +33,0 @@ "flow-typed": "^2.5.1", |
Sorry, the diff of this file is not supported yet
11068
114