mirror of
https://github.com/gchq/CyberChef
synced 2025-12-24 04:04:25 +00:00
Merge branch 'master' of github.com:gchq/CyberChef into node-lib
This commit is contained in:
@@ -27,10 +27,20 @@ class File {
|
||||
* @param {Object} stats (optional) - file stats e.g. lastModified
|
||||
*/
|
||||
constructor(data, name="", stats={}) {
|
||||
|
||||
if (!Array.isArray(data)) {
|
||||
data = [data];
|
||||
}
|
||||
|
||||
const buffers = data.map((d) => {
|
||||
if (d instanceof File) {
|
||||
return Buffer.from(d.data);
|
||||
}
|
||||
|
||||
if (d instanceof ArrayBuffer) {
|
||||
return Buffer.from(d);
|
||||
}
|
||||
|
||||
return Buffer.from(d);
|
||||
});
|
||||
const totalLength = buffers.reduce((p, c) => p + c.length, 0);
|
||||
|
||||
1607
src/node/index.mjs
Normal file
1607
src/node/index.mjs
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user