From 3fbcd71bc5fe62d6e0f5f0d39875d56b49e6dc48 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Wed, 21 Jan 2026 17:44:17 +0900 Subject: [PATCH] Fix type checks and update version in pipe-ipc.js Corrects type checking for callback and position parameters in app.js and pipe-ipc.js, ensuring proper function behavior. Also updates the version string in pipe-ipc.js to 0.1.26. --- app.js | 7 +++++-- lib/pipe-ipc.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 5e9a276..c95b39b 100644 --- a/app.js +++ b/app.js @@ -189,6 +189,10 @@ if (typeof CreateObject === "undefined") { if (typeof UseObject === "undefined") { var UseObject = function(progId, callback, dispose) { + if (typeof callback !== "function") { + return null; + } + if (typeof dispose !== "function") { dispose = function(obj) { try { @@ -199,8 +203,7 @@ if (typeof UseObject === "undefined") { var obj = CreateObject(progId); try { - return (typeof callback === "function" ? - callback(obj) : null); + return callback(obj); } finally { dispose(obj); obj = null; diff --git a/lib/pipe-ipc.js b/lib/pipe-ipc.js index 40fbb88..779635b 100644 --- a/lib/pipe-ipc.js +++ b/lib/pipe-ipc.js @@ -160,7 +160,7 @@ function Converter() { }; this.repositionObject = function(stream, position) { - position = (position !== "number" ? 0 : position); + position = (typeof position !== "number" ? 0 : position); var _dispose = function() {}; // prevent dispose after repositionObject @@ -571,7 +571,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist; exports.adSaveCreateOverWrite = adSaveCreateOverWrite; exports.adModeReadWrite = adModeReadWrite; -exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.25"; +exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.26"; exports.AUTHOR = "gnh1201@catswords.re.kr"; exports.global = global; exports.require = require;