Merge branch 'master' of github.com:gchq/CyberChef into node-lib

This commit is contained in:
d98762625 2019-04-04 15:21:52 +01:00
commit e4ee0fc397
52 changed files with 6038 additions and 1539 deletions

View file

@ -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

File diff suppressed because it is too large Load diff