mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 06:55:08 -04:00
Merge 8ffa6ace2f
into 7c8be12d52
This commit is contained in:
commit
f6d8c5b1c8
1 changed files with 3 additions and 1 deletions
4
src/core/Ingredient.mjs
Executable file → Normal file
4
src/core/Ingredient.mjs
Executable file → Normal file
|
@ -100,7 +100,7 @@ class Ingredient {
|
|||
*/
|
||||
static prepare(data, type) {
|
||||
let number;
|
||||
|
||||
|
||||
switch (type) {
|
||||
case "binaryString":
|
||||
case "binaryShortString":
|
||||
|
@ -116,6 +116,8 @@ class Ingredient {
|
|||
}
|
||||
case "number":
|
||||
if (data === null) return data;
|
||||
if (isNaN(data)) throw "Ingredient can not be empty.";
|
||||
|
||||
number = parseFloat(data);
|
||||
if (isNaN(number)) {
|
||||
const sample = Utils.truncate(data.toString(), 10);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue