Skip to content

Commit

Permalink
fixed result
Browse files Browse the repository at this point in the history
  • Loading branch information
obaydmerz committed Dec 12, 2023
1 parent 97e35e5 commit 5e29c44
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export class PowerJS {

const dllname = dllpath.match(/[^\\/]+\.dll$/g).reverse()[0];
dllpath = dllpath.replace(/\\/g, "\\\\");
if (dllname == undefined) throw new Error("The path should end with a *.dll");
if (dllname == undefined)
throw new Error("The path should end with a *.dll");

var name = dllname.split(".");
name.pop();
Expand Down Expand Up @@ -254,9 +255,11 @@ export class PowerJS {
}
}

this.#findOptimalShell(additionalShellNames)
this.#findOptimalShell(additionalShellNames);
if (this.#child == null) {
throw new Error("Cannot find a powershell interpreter! Try installing powershell or adding your one!");
throw new Error(
"Cannot find a powershell interpreter! Try installing powershell or adding your one!"
);
}
this.#setChildStreams();

Expand Down Expand Up @@ -311,7 +314,9 @@ export class PowerJS {
return;
}

resolve(json ? new Result(json) : null);
resolve(
typeof json != "object" ? json : json ? new Result(json) : null
);
},
});
});
Expand Down

0 comments on commit 5e29c44

Please sign in to comment.