We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Octokit.defaults(options)
1 parent 08515fe commit 9808d3fCopy full SHA for 9808d3f
src/index.ts
@@ -8,6 +8,18 @@ import { VERSION } from "./version";
8
import { withAuthorizationPrefix } from "./auth";
9
10
export class Octokit {
11
+ static defaults(defaults: OctokitOptions) {
12
+ return class OctokitWithDefaults extends this {
13
+ static defaults(newDefaults: OctokitOptions): typeof Octokit {
14
+ return Octokit.defaults(Object.assign({}, defaults, newDefaults));
15
+ }
16
+
17
+ constructor(options: OctokitOptions = {}) {
18
+ super(Object.assign({}, defaults, options));
19
20
+ };
21
22
23
static plugins: Plugin[] = [];
24
static plugin(plugins: Plugin | Plugin[]) {
25
const currentPlugins = this.plugins;
0 commit comments