mirror of
https://github.com/gchq/CyberChef.git
synced 2024-11-16 17:08:31 +01:00
making SyncDish composable! we want to exclude certain ops from top level api export (chef, etc) and make an Order (or something) class to start the chain off maybe?
This commit is contained in:
parent
55f7cac526
commit
f73452e01f
1 changed files with 14 additions and 0 deletions
|
@ -9,6 +9,7 @@ import Utils from "../core/Utils";
|
||||||
import Dish from "../core/Dish";
|
import Dish from "../core/Dish";
|
||||||
import BigNumber from "bignumber.js";
|
import BigNumber from "bignumber.js";
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
|
import * as ops from "./index";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subclass of Dish where `get` and `_translate` are synchronous.
|
* Subclass of Dish where `get` and `_translate` are synchronous.
|
||||||
|
@ -16,6 +17,16 @@ import log from "loglevel";
|
||||||
*/
|
*/
|
||||||
class SyncDish extends Dish {
|
class SyncDish extends Dish {
|
||||||
|
|
||||||
|
/** */
|
||||||
|
constructor(dish=null) {
|
||||||
|
super(dish);
|
||||||
|
|
||||||
|
for (const op in ops) {
|
||||||
|
this[op] = () => ops[op](this.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Synchronously returns the value of the data in the type format specified.
|
* Synchronously returns the value of the data in the type format specified.
|
||||||
*
|
*
|
||||||
|
@ -164,4 +175,7 @@ class SyncDish extends Dish {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default SyncDish;
|
export default SyncDish;
|
||||||
|
|
Loading…
Reference in a new issue