mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
Merge branch 'v9' of github.com:gchq/CyberChef into node-lib
This commit is contained in:
commit
0de89f3145
28 changed files with 386 additions and 303 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue