mirror of
https://github.com/gchq/CyberChef
synced 2026-01-03 09:03:37 +00:00
add immutable presentAs method to Dish for node REPL display. add test for exact match help
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user