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

This commit is contained in:
d98762625 2019-07-05 13:10:44 +01:00
commit 0de89f3145
28 changed files with 386 additions and 303 deletions

View file

@ -42,8 +42,8 @@ class Dish {
// Case: dishOrInput is dish object
if (dishOrInput &&
dishOrInput.hasOwnProperty("value") &&
dishOrInput.hasOwnProperty("type")) {
Object.prototype.hasOwnProperty.call(dishOrInput, "value") &&
Object.prototype.hasOwnProperty.call(dishOrInput, "type")) {
this.set(dishOrInput.value, dishOrInput.type);
// input and type defined separately
} else if (dishOrInput && type !== null) {
@ -205,7 +205,7 @@ class Dish {
* Detects the MIME type of the current dish
* @returns {string}
*/
async detectDishType() {
detectDishType() {
const data = new Uint8Array(this.value.slice(0, 2048)),
types = detectFileType(data);
@ -236,7 +236,7 @@ class Dish {
break;
case Dish.ARRAY_BUFFER:
case Dish.BYTE_ARRAY:
title = await this.detectDishType();
title = this.detectDishType();
if (title !== null) break;
// fall through if no mime type was detected
default: