node-opcua-debug
Advanced tools
Comparing version 2.10.0 to 2.16.0
@@ -10,3 +10,2 @@ "use strict"; | ||
const fs = require("fs"); | ||
const _ = require("underscore"); | ||
const util = require("util"); | ||
@@ -23,4 +22,4 @@ const node_opcua_assert_1 = require("node-opcua-assert"); | ||
let oldConsoleLog; | ||
node_opcua_assert_1.assert(_.isFunction(actionFct)); | ||
node_opcua_assert_1.assert(!callback || _.isFunction(callback)); | ||
node_opcua_assert_1.assert(typeof actionFct === "function"); | ||
node_opcua_assert_1.assert(!callback || typeof callback === "function"); | ||
const isAsync = actionFct && actionFct.length; | ||
@@ -65,3 +64,3 @@ const logFile = get_temp_filename_1.getTempFilename(tmpFile); | ||
actionFct((err) => { | ||
node_opcua_assert_1.assert(_.isFunction(callback)); | ||
node_opcua_assert_1.assert(typeof callback === "function"); | ||
console.log = oldConsoleLog; | ||
@@ -68,0 +67,0 @@ if (err) { |
{ | ||
"name": "node-opcua-debug", | ||
"version": "2.10.0", | ||
"version": "2.16.0", | ||
"description": "pure nodejs OPCUA SDK - module -debug", | ||
@@ -13,4 +13,4 @@ "scripts": { | ||
"hexy": "^0.3.0", | ||
"node-opcua-assert": "2.10.0", | ||
"node-opcua-buffer-utils": "2.10.0", | ||
"node-opcua-assert": "2.16.0", | ||
"node-opcua-buffer-utils": "2.16.0", | ||
"underscore": "^1.10.2" | ||
@@ -39,3 +39,3 @@ }, | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "f1c467c28f8bef1cc04ab54c57a555bd4c95ee45" | ||
"gitHead": "9fa7d50952a7c39ff6790888a2bd6f32fe46836d" | ||
} |
@@ -7,3 +7,2 @@ /** | ||
import * as fs from "fs"; | ||
import * as _ from "underscore"; | ||
import * as util from "util"; | ||
@@ -20,12 +19,7 @@ | ||
*/ | ||
export function redirectToFile( | ||
tmpFile: string, | ||
actionFct: Function, | ||
callback: ((err?: Error) => void) | null | ||
): void { | ||
export function redirectToFile(tmpFile: string, actionFct: Function, callback: ((err?: Error) => void) | null): void { | ||
let oldConsoleLog: any; | ||
assert(_.isFunction(actionFct)); | ||
assert(!callback || _.isFunction(callback)); | ||
assert(typeof actionFct === "function"); | ||
assert(!callback || typeof callback === "function"); | ||
@@ -40,3 +34,2 @@ const isAsync = actionFct && actionFct.length; | ||
function _write_to_file(...args: [any, ...any[]]) { | ||
const msg = util.format.apply(null, args); | ||
@@ -82,3 +75,3 @@ f.write(msg + "\n"); | ||
actionFct((err: Error) => { | ||
assert(_.isFunction(callback)); | ||
assert(typeof callback === "function"); | ||
console.log = oldConsoleLog; | ||
@@ -85,0 +78,0 @@ if (err) { |
Sorry, the diff of this file is not supported yet
39310
669
+ Addednode-opcua-assert@2.16.0(transitive)
+ Addednode-opcua-buffer-utils@2.16.0(transitive)
- Removednode-opcua-assert@2.10.0(transitive)
- Removednode-opcua-buffer-utils@2.10.0(transitive)
Updatednode-opcua-assert@2.16.0