2
0
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:
d98762625
2019-03-20 11:57:47 +00:00
parent 8f5f3e56cb
commit 8eed2232ee
5 changed files with 55 additions and 11 deletions

View File

@@ -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"));
}
}