@octokit-next/endpoint
Advanced tools
Comparing version 2.5.1 to 2.5.2
@@ -78,4 +78,2 @@ import { addQueryParameters } from "./util/add-query-parameters.js"; | ||
body = remainingParameters; | ||
} else { | ||
headers["content-length"] = 0; | ||
} | ||
@@ -82,0 +80,0 @@ } |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "2.5.1"; | ||
export const VERSION = "2.5.2"; |
{ | ||
"name": "@octokit-next/endpoint", | ||
"version": "2.5.1", | ||
"version": "2.5.2", | ||
"publishConfig": { | ||
@@ -26,18 +26,11 @@ "access": "public" | ||
"test": "npm run test:code && npm run test:types", | ||
"test:code": "c8 ava test", | ||
"test:code": "c8 --100 ava test", | ||
"test:types": "tsd" | ||
}, | ||
"dependencies": { | ||
"@octokit-next/types": "2.5.1", | ||
"@octokit-next/types": "2.5.2", | ||
"is-plain-obj": "^4.0.0", | ||
"type-fest": "^3.0.0", | ||
"universal-user-agent": "^7.0.0" | ||
}, | ||
"c8": { | ||
"check-coverage": true, | ||
"lines": 100, | ||
"functions": 100, | ||
"branches": 100, | ||
"statements": 100 | ||
} | ||
} |
@@ -10,21 +10,2 @@ # endpoint.js | ||
<!-- update table of contents by running `npx markdown-toc README.md -i` --> | ||
<!-- toc --> | ||
- [Usage](#usage) | ||
- [API](#api) | ||
- [`endpoint(route, options)` or `endpoint(options)`](#endpointroute-options-or-endpointoptions) | ||
- [`endpoint.withDefaults()`](#endpointdefaults) | ||
- [`endpoint.DEFAULTS`](#endpointdefaults) | ||
- [`endpoint.merge(route, options)` or `endpoint.merge(options)`](#endpointmergeroute-options-or-endpointmergeoptions) | ||
- [`endpoint.parse()`](#endpointparse) | ||
- [Types](#types) | ||
- [Special cases](#special-cases) | ||
- [The `data` parameter – set request body directly](#the-data-parameter-%E2%80%93-set-request-body-directly) | ||
- [Set parameters for both the URL/query and the request body](#set-parameters-for-both-the-urlquery-and-the-request-body) | ||
- [LICENSE](#license) | ||
<!-- tocstop --> | ||
## Usage | ||
@@ -31,0 +12,0 @@ |
@@ -142,3 +142,2 @@ import { Agent } from "node:http"; | ||
accept: "application/vnd.github.v3+json", | ||
"content-length": 0, | ||
"user-agent": userAgent, | ||
@@ -442,1 +441,58 @@ }, | ||
}); | ||
test("DELETE without request body", (t) => { | ||
const options = endpoint("DELETE /user/following/{username}", { | ||
headers: { | ||
authorization: `token 0000000000000000000000000000000000000001`, | ||
}, | ||
username: "octocat", | ||
}); | ||
t.deepEqual(options, { | ||
method: "DELETE", | ||
url: "https://api.github.com/user/following/octocat", | ||
headers: { | ||
authorization: `token 0000000000000000000000000000000000000001`, | ||
accept: "application/vnd.github.v3+json", | ||
"user-agent": userAgent, | ||
}, | ||
}); | ||
}); | ||
test("POST without request body", (t) => { | ||
const options = endpoint("POST /widgets", { | ||
headers: { | ||
authorization: `token 0000000000000000000000000000000000000001`, | ||
}, | ||
}); | ||
t.deepEqual(options, { | ||
method: "POST", | ||
url: "https://api.github.com/widgets", | ||
headers: { | ||
authorization: `token 0000000000000000000000000000000000000001`, | ||
accept: "application/vnd.github.v3+json", | ||
"user-agent": userAgent, | ||
}, | ||
}); | ||
}); | ||
test("PATCH without request body", (t) => { | ||
const options = endpoint("PATCH /widgets/{id}", { | ||
headers: { | ||
authorization: `token 0000000000000000000000000000000000000001`, | ||
}, | ||
id: "my-widget", | ||
}); | ||
t.deepEqual(options, { | ||
body: "", | ||
method: "PATCH", | ||
url: "https://api.github.com/widgets/my-widget", | ||
headers: { | ||
authorization: `token 0000000000000000000000000000000000000001`, | ||
accept: "application/vnd.github.v3+json", | ||
"user-agent": userAgent, | ||
}, | ||
}); | ||
}); |
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
56332
1289
520
+ Added@octokit-next/types@2.5.2(transitive)
- Removed@octokit-next/types@2.5.1(transitive)
Updated@octokit-next/types@2.5.2