mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 07:16:17 -04:00
Merge branch 'master' of github.com:gchq/CyberChef into node-lib
This commit is contained in:
commit
e4ee0fc397
52 changed files with 6038 additions and 1539 deletions
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue