mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-02 22:21:01 +01:00
Default inputNum to -1 when one isn't sent.
Improve jsdoc comments
This commit is contained in:
parent
4a0f62b636
commit
b3cb800f35
@ -37,9 +37,8 @@ self.postMessage({
|
|||||||
/**
|
/**
|
||||||
* Respond to message from parent thread.
|
* Respond to message from parent thread.
|
||||||
*
|
*
|
||||||
* An inputNum only needs to be sent when baking.
|
* inputNum is optional and only used for baking multiple inputs.
|
||||||
* (The background ChefWorker doesn't send one, but as
|
* Defaults to -1 when one isn't sent with the bake message.
|
||||||
* it only deals with one input at a time it isn't needed)
|
|
||||||
*
|
*
|
||||||
* Messages should have the following format:
|
* Messages should have the following format:
|
||||||
* {
|
* {
|
||||||
@ -99,7 +98,7 @@ async function bake(data) {
|
|||||||
// Ensure the relevant modules are loaded
|
// Ensure the relevant modules are loaded
|
||||||
self.loadRequiredModules(data.recipeConfig);
|
self.loadRequiredModules(data.recipeConfig);
|
||||||
try {
|
try {
|
||||||
self.inputNum = data.inputNum;
|
self.inputNum = (data.inputNum !== undefined) ? data.inputNum : -1;
|
||||||
const response = await self.chef.bake(
|
const response = await self.chef.bake(
|
||||||
data.input, // The user's input
|
data.input, // The user's input
|
||||||
data.recipeConfig, // The configuration of the recipe
|
data.recipeConfig, // The configuration of the recipe
|
||||||
|
Loading…
Reference in New Issue
Block a user