Skip to content

Commit

Permalink
fix: error on isError due to changes of output format of npm view (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
sotarok committed Sep 2, 2021
1 parent 3c10b4b commit 12d1df4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/can-npm-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const viewPackage = (packageName, registry, options) => {
};
};
const isError = (json) => {
return json && "error" in json;
return json && typeof json !== "string" && "error" in json;
};
const is404Error = (json) => {
return isError(json) && json.error.code === "E404";
Expand Down

0 comments on commit 12d1df4

Please sign in to comment.