github-repository-provider 7.26.0 → 7.26.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/package.json +2 -2
- package/src/github-branch.mjs +27 -13
package/README.md
CHANGED
|
@@ -68,6 +68,8 @@ console.log(entry.name);
|
|
|
68
68
|
* [open](#open)
|
|
69
69
|
* [Parameters](#parameters-10)
|
|
70
70
|
* [GithubRepository](#githubrepository)
|
|
71
|
+
* [commits](#commits)
|
|
72
|
+
* [Parameters](#parameters-11)
|
|
71
73
|
* [initializeBranches](#initializebranches)
|
|
72
74
|
* [initializeTags](#initializetags)
|
|
73
75
|
* [urls](#urls)
|
|
@@ -75,9 +77,9 @@ console.log(entry.name);
|
|
|
75
77
|
* [homePageURL](#homepageurl)
|
|
76
78
|
* [update](#update)
|
|
77
79
|
* [refId](#refid)
|
|
78
|
-
* [Parameters](#parameters-11)
|
|
79
|
-
* [deletePullRequest](#deletepullrequest)
|
|
80
80
|
* [Parameters](#parameters-12)
|
|
81
|
+
* [deletePullRequest](#deletepullrequest)
|
|
82
|
+
* [Parameters](#parameters-13)
|
|
81
83
|
* [initializeHooks](#initializehooks)
|
|
82
84
|
|
|
83
85
|
## GithubBranch
|
|
@@ -278,6 +280,16 @@ Returns **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Glob
|
|
|
278
280
|
|
|
279
281
|
Repository on GitHub.
|
|
280
282
|
|
|
283
|
+
### commits
|
|
284
|
+
|
|
285
|
+
<https://docs.github.com/en/rest/reference/commits#list-commits>
|
|
286
|
+
|
|
287
|
+
#### Parameters
|
|
288
|
+
|
|
289
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
290
|
+
|
|
291
|
+
Returns **AsyncIterator\<Commit>**
|
|
292
|
+
|
|
281
293
|
### initializeBranches
|
|
282
294
|
|
|
283
295
|
<https://developer.github.com/v3/repos/branches/#list-branches>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-repository-provider",
|
|
3
|
-
"version": "7.26.
|
|
3
|
+
"version": "7.26.3",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"ava": "^4.1.0",
|
|
43
43
|
"c8": "^7.11.0",
|
|
44
44
|
"documentation": "^13.2.5",
|
|
45
|
-
"repository-provider-test-support": "^
|
|
45
|
+
"repository-provider-test-support": "^2.0.0",
|
|
46
46
|
"semantic-release": "^19.0.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
package/src/github-branch.mjs
CHANGED
|
@@ -109,17 +109,25 @@ export class GithubBranch extends Branch {
|
|
|
109
109
|
this._entries = new Map();
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
const f = async () => {
|
|
113
|
+
const { json } = await this.provider.fetchJSON(
|
|
114
|
+
`repos/${this.slug}/contents/${name}?ref=${this.ref}`
|
|
115
|
+
);
|
|
115
116
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
const entry = new this.entryClass(
|
|
118
|
+
name,
|
|
119
|
+
Buffer.from(json.content, "base64")
|
|
120
|
+
);
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
122
|
+
this._entries.set(name, entry);
|
|
123
|
+
return entry;
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const p = f();
|
|
127
|
+
|
|
128
|
+
this._entries.set(name, p);
|
|
129
|
+
|
|
130
|
+
return p;
|
|
123
131
|
}
|
|
124
132
|
|
|
125
133
|
/**
|
|
@@ -232,11 +240,17 @@ class LazyBufferContentEntry extends BufferContentEntryMixin(ContentEntry) {
|
|
|
232
240
|
}
|
|
233
241
|
|
|
234
242
|
const branch = this.branch;
|
|
235
|
-
const { json } = await branch.provider.fetchJSON(
|
|
236
|
-
`repos/${branch.slug}/contents/${this.name}?ref=${branch.ref}`
|
|
237
|
-
);
|
|
238
243
|
|
|
239
|
-
|
|
244
|
+
const f = async () => {
|
|
245
|
+
const { json } = await branch.provider.fetchJSON(
|
|
246
|
+
`repos/${branch.slug}/contents/${this.name}?ref=${branch.ref}`
|
|
247
|
+
);
|
|
248
|
+
|
|
249
|
+
this._buffer = Buffer.from(json.content, "base64");
|
|
250
|
+
return this._buffer;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
this._buffer = f();
|
|
240
254
|
return this._buffer;
|
|
241
255
|
}
|
|
242
256
|
}
|