@octokit-next/endpoint
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -102,3 +102,3 @@ import { expectType, expectNotType } from "tsd"; | ||
export function apiWithDefaults() { | ||
const myEndpoint = endpoint.withDefaults({ | ||
const myEndpoint = endpoint.defaults({ | ||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3", | ||
@@ -118,3 +118,3 @@ headers: { | ||
const myEndpointWithToken2 = myEndpoint.withDefaults({ | ||
const myEndpointWithToken2 = myEndpoint.defaults({ | ||
headers: { | ||
@@ -135,3 +135,3 @@ authorization: `token 0000000000000000000000000000000000000002`, | ||
expectType<"https://api.github.com">(endpoint.DEFAULTS.baseUrl); | ||
const myEndpoint = endpoint.withDefaults({ | ||
const myEndpoint = endpoint.defaults({ | ||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3", | ||
@@ -148,4 +148,21 @@ }); | ||
export function apiDeepDefaults() { | ||
expectType<"application/vnd.github.v3+json">( | ||
endpoint.DEFAULTS.headers.accept | ||
); | ||
const myEndpoint = endpoint.defaults({ | ||
headers: { | ||
foo: "bar", | ||
}, | ||
}); | ||
// TODO: defaults should deeply merge | ||
// expectType<"application/vnd.github.v3+json">( | ||
// myEndpoint.DEFAULTS.headers.accept | ||
// ); | ||
expectType<string>(myEndpoint.DEFAULTS.headers.foo); | ||
} | ||
export function apiMerge() { | ||
const myProjectEndpoint = endpoint.withDefaults({ | ||
const myProjectEndpoint = endpoint.defaults({ | ||
baseUrl: "https://github-enterprise.acme-inc.com/api/v3", | ||
@@ -152,0 +169,0 @@ headers: { |
@@ -1,1 +0,1 @@ | ||
export const VERSION = "2.2.0"; | ||
export const VERSION = "2.3.0"; |
{ | ||
"name": "@octokit-next/endpoint", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"publishConfig": { | ||
@@ -30,3 +30,3 @@ "access": "public" | ||
"dependencies": { | ||
"@octokit-next/types": "2.2.0", | ||
"@octokit-next/types": "2.3.0", | ||
"is-plain-obj": "^4.0.0", | ||
@@ -33,0 +33,0 @@ "type-fest": "^3.0.0", |
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
56034
1263
+ Added@octokit-next/types@2.3.0(transitive)
- Removed@octokit-next/types@2.2.0(transitive)
Updated@octokit-next/types@2.3.0