Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions hydra-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const UMFMessage = hydra.getUMFMessageHelper();

const CONFIG_FILE_VERSION = 2;

// Works like the es2020 ?? operator
const nCoalescg = (...args) => args.find((el) => el != null && el != undefined);

/**
* @name Program
*/
Expand Down Expand Up @@ -626,7 +629,7 @@ class Program {
});
hydra.makeAPIRequest(msg)
.then((res) => {
if ((res.payLoad ?? res) == undefined) {
if (nCoalescg(res.payLoad, res) == undefined) {
console.trace(`Error parsing response from service.`);
this.exitApp();
return;
Expand Down Expand Up @@ -666,7 +669,7 @@ class Program {
});
hydra.makeAPIRequest(msg)
.then((res) => {
if ((res.payLoad ?? res) == undefined) {
if (nCoalescg(res.payLoad, res) == undefined) {
console.trace(`Error parsing response from service.`);
this.exitApp();
return;
Expand Down