@octokit/plugin-enterprise-compatibility
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -7,3 +7,3 @@ 'use strict'; | ||
const VERSION = "1.2.1"; | ||
const VERSION = "1.2.2"; | ||
@@ -55,2 +55,4 @@ function isIssueLabelsUpdateOrReplace({ | ||
/* istanbul ignore if */ | ||
if (options.request.validate) { | ||
@@ -57,0 +59,0 @@ delete options.request.validate.labels; |
import { RequestError } from "@octokit/request-error"; | ||
import { VERSION } from "./version"; | ||
import { isIssueLabelsUpdateOrReplace } from "./is-issue-labels-update-or-replace"; | ||
import { isGetReference, isListReferences } from "./is-get-reference-or-list-references"; | ||
import { isGetReference, isListReferences, } from "./is-get-reference-or-list-references"; | ||
export function enterpriseCompatibility(octokit) { | ||
@@ -12,2 +12,3 @@ octokit.hook.wrap("request", async (request, options) => { | ||
// for @octokit/rest v16.x, remove validation of labels option | ||
/* istanbul ignore if */ | ||
if (options.request.validate) { | ||
@@ -27,3 +28,3 @@ delete options.request.validate.labels; | ||
throw new RequestError(`More than one reference found at "${options.url}"`, 404, { | ||
request: options | ||
request: options, | ||
}); | ||
@@ -45,3 +46,3 @@ } | ||
headers: error.headers, | ||
data: [] | ||
data: [], | ||
}; | ||
@@ -48,0 +49,0 @@ } |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "1.2.1"; | ||
export const VERSION = "1.2.2"; |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "1.2.1"; | ||
export declare const VERSION = "1.2.2"; |
import { RequestError } from '@octokit/request-error'; | ||
const VERSION = "1.2.1"; | ||
const VERSION = "1.2.2"; | ||
@@ -37,2 +37,3 @@ function isIssueLabelsUpdateOrReplace({ method, url }) { | ||
// for @octokit/rest v16.x, remove validation of labels option | ||
/* istanbul ignore if */ | ||
if (options.request.validate) { | ||
@@ -52,3 +53,3 @@ delete options.request.validate.labels; | ||
throw new RequestError(`More than one reference found at "${options.url}"`, 404, { | ||
request: options | ||
request: options, | ||
}); | ||
@@ -70,3 +71,3 @@ } | ||
headers: error.headers, | ||
data: [] | ||
data: [], | ||
}; | ||
@@ -73,0 +74,0 @@ } |
{ | ||
"name": "@octokit/plugin-enterprise-compatibility", | ||
"description": "Octokit plugin for improving GHE compatibility", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"license": "MIT", | ||
@@ -22,3 +22,3 @@ "files": [ | ||
"dependencies": { | ||
"@octokit/request-error": "^1.2.0", | ||
"@octokit/request-error": "^2.0.0", | ||
"@octokit/types": "^2.0.1" | ||
@@ -28,16 +28,16 @@ }, | ||
"@octokit/core": "^2.1.0", | ||
"@octokit/rest": "^16.24.2", | ||
"@octokit/rest": "^17.0.0", | ||
"@pika/pack": "^0.5.0", | ||
"@pika/plugin-build-node": "^0.6.1", | ||
"@pika/plugin-build-web": "^0.6.1", | ||
"@pika/plugin-ts-standard-pkg": "^0.6.1", | ||
"@pika/plugin-build-node": "^0.9.0", | ||
"@pika/plugin-build-web": "^0.9.0", | ||
"@pika/plugin-ts-standard-pkg": "^0.9.0", | ||
"@types/fetch-mock": "^7.3.1", | ||
"@types/jest": "^24.0.21", | ||
"@types/node": "^12.12.5", | ||
"fetch-mock": "^7.5.1", | ||
"jest": "^24.9.0", | ||
"prettier": "^1.18.2", | ||
"semantic-release": "^15.13.12", | ||
"@types/jest": "^25.1.0", | ||
"@types/node": "^13.1.0", | ||
"fetch-mock": "^9.0.0", | ||
"jest": "^25.1.0", | ||
"prettier": "^2.0.1", | ||
"semantic-release": "^17.0.0", | ||
"semantic-release-plugin-update-version-in-files": "^1.0.0", | ||
"ts-jest": "^24.1.0", | ||
"ts-jest": "^25.1.0", | ||
"typescript": "^3.6.4" | ||
@@ -44,0 +44,0 @@ }, |
@@ -42,3 +42,3 @@ # plugin-enterprise-compatibility.js | ||
const { | ||
enterpriseCompatibility | ||
enterpriseCompatibility, | ||
} = require("@octokit/plugin-enterprise-compatibility"); | ||
@@ -54,3 +54,3 @@ ``` | ||
const octokit = new MyOctokit({ | ||
auth: "token123" | ||
auth: "token123", | ||
}); | ||
@@ -62,3 +62,3 @@ | ||
number, | ||
labels: ["foo", "bar"] | ||
labels: ["foo", "bar"], | ||
}); | ||
@@ -65,0 +65,0 @@ // sends ["foo", "bar"] instead of {"labels":["foo", "bar"]} as request body |
Sorry, the diff of this file is not supported yet
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
26615
246
+ Added@octokit/openapi-types@12.11.0(transitive)
+ Added@octokit/request-error@2.1.0(transitive)
+ Added@octokit/types@6.41.0(transitive)
- Removed@octokit/request-error@1.2.1(transitive)