@octokit/request
Advanced tools
Comparing version 9.1.2 to 9.1.3
@@ -138,14 +138,11 @@ // pkg/dist-src/index.js | ||
function toErrorMessage(data) { | ||
if (typeof data === "string") return data; | ||
let suffix; | ||
if ("documentation_url" in data) { | ||
suffix = ` - ${data.documentation_url}`; | ||
} else { | ||
suffix = ""; | ||
if (typeof data === "string") { | ||
return data; | ||
} | ||
if (data instanceof ArrayBuffer) { | ||
return "Unknown error"; | ||
} | ||
if ("message" in data) { | ||
if (Array.isArray(data.errors)) { | ||
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; | ||
} | ||
return `${data.message}${suffix}`; | ||
const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : ""; | ||
return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`; | ||
} | ||
@@ -152,0 +149,0 @@ return `Unknown error: ${JSON.stringify(data)}`; |
@@ -112,14 +112,11 @@ import { isPlainObject } from "./is-plain-object.js"; | ||
function toErrorMessage(data) { | ||
if (typeof data === "string") return data; | ||
let suffix; | ||
if ("documentation_url" in data) { | ||
suffix = ` - ${data.documentation_url}`; | ||
} else { | ||
suffix = ""; | ||
if (typeof data === "string") { | ||
return data; | ||
} | ||
if (data instanceof ArrayBuffer) { | ||
return "Unknown error"; | ||
} | ||
if ("message" in data) { | ||
if (Array.isArray(data.errors)) { | ||
return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; | ||
} | ||
return `${data.message}${suffix}`; | ||
const suffix = "documentation_url" in data ? ` - ${data.documentation_url}` : ""; | ||
return Array.isArray(data.errors) ? `${data.message}: ${data.errors.map((v) => JSON.stringify(v)).join(", ")}${suffix}` : `${data.message}${suffix}`; | ||
} | ||
@@ -126,0 +123,0 @@ return `Unknown error: ${JSON.stringify(data)}`; |
@@ -1,4 +0,4 @@ | ||
const VERSION = "9.1.2"; | ||
const VERSION = "9.1.3"; | ||
export { | ||
VERSION | ||
}; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "9.1.2"; | ||
export declare const VERSION = "9.1.3"; |
{ | ||
"name": "@octokit/request", | ||
"version": "9.1.2", | ||
"version": "9.1.3", | ||
"type": "module", | ||
@@ -33,3 +33,3 @@ "publishConfig": { | ||
"glob": "^10.2.4", | ||
"prettier": "3.3.2", | ||
"prettier": "3.3.3", | ||
"semantic-release-plugin-update-version-in-files": "^1.0.0", | ||
@@ -36,0 +36,0 @@ "typescript": "^5.0.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43762
371