mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-21 15:26:16 -04:00
add immutable presentAs method to Dish for node REPL display. add test for exact match help
This commit is contained in:
parent
8f5f3e56cb
commit
8eed2232ee
5 changed files with 55 additions and 11 deletions
|
@ -53,14 +53,14 @@ class NodeDish extends Dish {
|
|||
* Avoid coercion to a String primitive.
|
||||
*/
|
||||
toString() {
|
||||
return this.get(Dish.typeEnum("string"));
|
||||
return this.presentAs(Dish.typeEnum("string"));
|
||||
}
|
||||
|
||||
/**
|
||||
* What we want to log to the console.
|
||||
*/
|
||||
[util.inspect.custom](depth, options) {
|
||||
return this.get(Dish.typeEnum("string"));
|
||||
return this.presentAs(Dish.typeEnum("string"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,14 +68,14 @@ class NodeDish extends Dish {
|
|||
* Log only the value to the console in node.
|
||||
*/
|
||||
inspect() {
|
||||
return this.get(Dish.typeEnum("string"));
|
||||
return this.presentAs(Dish.typeEnum("string"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Avoid coercion to a Number primitive.
|
||||
*/
|
||||
valueOf() {
|
||||
return this.get(Dish.typeEnum("number"));
|
||||
return this.presentAs(Dish.typeEnum("number"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue