mirror of
https://github.com/gchq/CyberChef
synced 2025-12-20 10:13:42 +00:00
export Arithmetic funcs individually. Use existing Delim
This commit is contained in:
@@ -5,9 +5,11 @@
|
||||
* @license Apache-2.0
|
||||
*/
|
||||
|
||||
import Operation from "../Operation";
|
||||
import Arithmetic from "../lib/Arithmetic";
|
||||
import BigNumber from "bignumber.js";
|
||||
import Operation from "../Operation";
|
||||
import { div, createNumArray } from "../lib/Arithmetic";
|
||||
import { DELIM_OPTIONS } from "../lib/Delim";
|
||||
|
||||
|
||||
/**
|
||||
* Divide operation
|
||||
@@ -29,7 +31,7 @@ class Divide extends Operation {
|
||||
{
|
||||
"name": "Delimiter",
|
||||
"type": "option",
|
||||
"value": Arithmetic.DELIM_OPTIONS,
|
||||
"value": DELIM_OPTIONS,
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -40,7 +42,7 @@ class Divide extends Operation {
|
||||
* @returns {BigNumber}
|
||||
*/
|
||||
run(input, args) {
|
||||
const val = Arithmetic._div(Arithmetic._createNumArray(input, args[0]));
|
||||
const val = div(createNumArray(input, args[0]));
|
||||
return val instanceof BigNumber ? val : new BigNumber(NaN);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user