node-opcua-debug
Advanced tools
Comparing version 2.62.7 to 2.63.0
@@ -12,9 +12,10 @@ "use strict"; | ||
const debugFlags = {}; | ||
const sTraceFlag = process.env && process.env.DEBUG; | ||
const _process = (typeof process === "object") ? process : { env: {} }; | ||
const sTraceFlag = _process.env && _process.env.DEBUG; | ||
// istanbul ignore next | ||
if (process.env && false) { | ||
if (_process.env && false) { | ||
// this code can be activated to help detecting | ||
// when a external module overwrite one of the | ||
// environment variable that we may be using as well. | ||
const old = Object.assign({}, process.env); | ||
const old = Object.assign({}, _process.env); | ||
const handler = { | ||
@@ -30,6 +31,6 @@ get: function (obj, prop) { | ||
}; | ||
process.env = new Proxy(old, handler); | ||
_process.env = new Proxy(old, handler); | ||
} | ||
const maxLines = process.env && process.env.NODEOPCUA_DEBUG_MAXLINE_PER_MESSAGE | ||
? parseInt(process.env.NODEOPCUA_DEBUG_MAXLINE_PER_MESSAGE, 10) | ||
const maxLines = _process.env && _process.env.NODEOPCUA_DEBUG_MAXLINE_PER_MESSAGE | ||
? parseInt(_process.env.NODEOPCUA_DEBUG_MAXLINE_PER_MESSAGE, 10) | ||
: 25; | ||
@@ -36,0 +37,0 @@ function extractBasename(name) { |
@@ -28,5 +28,5 @@ "use strict"; | ||
function _write_to_file(...args) { | ||
const msg = util_1.format.apply(null, args); | ||
const msg = util_1.format.call(null, ...args); | ||
f.write(msg + "\n"); | ||
if (process.env.DEBUG) { | ||
if (typeof process === "object" && process.env.DEBUG) { | ||
oldConsoleLog.call(console, msg); | ||
@@ -33,0 +33,0 @@ } |
{ | ||
"name": "node-opcua-debug", | ||
"version": "2.62.7", | ||
"version": "2.63.0", | ||
"description": "pure nodejs OPCUA SDK - module -debug", | ||
@@ -12,4 +12,4 @@ "scripts": { | ||
"hexy": "0.3.2", | ||
"node-opcua-assert": "2.55.0", | ||
"node-opcua-buffer-utils": "2.62.7" | ||
"node-opcua-assert": "2.63.0", | ||
"node-opcua-buffer-utils": "2.63.0" | ||
}, | ||
@@ -37,3 +37,3 @@ "devDependencies": { | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "90bb9139261a0edbb531081afcc6904c74e9ee52" | ||
"gitHead": "df4335584455009c6caa21ed6a2fa42caa9104ed" | ||
} |
@@ -32,5 +32,5 @@ /** | ||
function _write_to_file(...args: [any, ...any[]]) { | ||
const msg = format.apply(null, args); | ||
const msg = format.call(null, ...args); | ||
f.write(msg + "\n"); | ||
if (process.env.DEBUG) { | ||
if (typeof process === "object" && process.env.DEBUG) { | ||
oldConsoleLog.call(console, msg); | ||
@@ -37,0 +37,0 @@ } |
@@ -11,10 +11,11 @@ /** | ||
const sTraceFlag = process.env && (process.env.DEBUG as string); | ||
const _process = (typeof process === "object") ? process : { env: {} as Record<string, string> }; | ||
const sTraceFlag = _process.env && (_process.env.DEBUG as string); | ||
// istanbul ignore next | ||
if (process.env && false) { | ||
if (_process.env && false) { | ||
// this code can be activated to help detecting | ||
// when a external module overwrite one of the | ||
// environment variable that we may be using as well. | ||
const old = { ...process.env }; | ||
const old = { ..._process.env }; | ||
const handler = { | ||
@@ -30,7 +31,7 @@ get: function (obj: any, prop: string) { | ||
}; | ||
process.env = new Proxy(old, handler); | ||
_process.env = new Proxy(old, handler); | ||
} | ||
const maxLines = | ||
process.env && process.env.NODEOPCUA_DEBUG_MAXLINE_PER_MESSAGE | ||
? parseInt(process.env.NODEOPCUA_DEBUG_MAXLINE_PER_MESSAGE, 10) | ||
_process.env && _process.env.NODEOPCUA_DEBUG_MAXLINE_PER_MESSAGE | ||
? parseInt(_process.env.NODEOPCUA_DEBUG_MAXLINE_PER_MESSAGE, 10) | ||
: 25; | ||
@@ -37,0 +38,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
47461
846
4
+ Addednode-opcua-assert@2.63.0(transitive)
+ Addednode-opcua-buffer-utils@2.63.0(transitive)
- Removednode-opcua-assert@2.55.0(transitive)
- Removednode-opcua-buffer-utils@2.62.7(transitive)
Updatednode-opcua-assert@2.63.0