Update pipe-ipc.js

This commit is contained in:
Namhyeon Go 2023-09-26 11:24:12 +09:00 committed by GitHub
parent 20ac966a61
commit ea5a70e03d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -436,6 +436,8 @@ function PipeIPC() {
};
this.readTextFromFile = function(filename, charset) {
charset = (typeof charset !== "undefined" ? charset : this.charset);
var text = '';
var isFileExists = checkFileExists(filename);
@ -463,12 +465,14 @@ function PipeIPC() {
};
this.loadFromFile = function(filename, charset) {
charset = (typeof charset !== "undefined" ? this.charset : charset);
charset = (typeof charset !== "undefined" ? charset : this.charset);
this.write(this.readTextFromFile(filename, charset), ForWriting);
};
this.reload = function(charset) {
charset = (typeof charset !== "undefined" ? this.charset : charset);
charset = (typeof charset !== "undefined" ? charset : this.charset);
this.loadFromFile(this.path, charset);
};
}
@ -498,7 +502,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist;
exports.adSaveCreateOverWrite = adSaveCreateOverWrite;
exports.adModeReadWrite = adModeReadWrite;
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.18";
exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.19";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = require;