mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Allow node.status() to be passed number/bool types
Adds to the existing support for string types. Also adds unit tests for all three cases
This commit is contained in:
@@ -539,7 +539,12 @@ Node.prototype.metric = function(eventname, msg, metricValue) {
|
||||
* status: "simple text status"
|
||||
*/
|
||||
Node.prototype.status = function(status) {
|
||||
if (typeof(status) === "string") { status = {text:status}; }
|
||||
switch (typeof status) {
|
||||
case "string":
|
||||
case "number":
|
||||
case "boolean":
|
||||
status = {text:""+status}
|
||||
}
|
||||
this._flow.handleStatus(this,status);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user