github-repository-provider 7.25.55 → 7.25.58
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 +3 -3
- package/package.json +2 -2
- package/src/github-branch.mjs +15 -1
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ console.log(entry.name);
|
|
|
40
40
|
* [Parameters](#parameters-1)
|
|
41
41
|
* [entry](#entry)
|
|
42
42
|
* [Parameters](#parameters-2)
|
|
43
|
-
* [
|
|
43
|
+
* [commitForSha](#commitforsha)
|
|
44
44
|
* [Parameters](#parameters-3)
|
|
45
45
|
* [tree](#tree)
|
|
46
46
|
* [Parameters](#parameters-4)
|
|
@@ -117,7 +117,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
117
117
|
|
|
118
118
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
119
119
|
|
|
120
|
-
###
|
|
120
|
+
### commitForSha
|
|
121
121
|
|
|
122
122
|
<https://developer.github.com/v3/git/commits/#get-a-commit>
|
|
123
123
|
|
|
@@ -125,7 +125,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
125
125
|
|
|
126
126
|
* `sha` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
127
127
|
|
|
128
|
-
Returns **[
|
|
128
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** response
|
|
129
129
|
|
|
130
130
|
### tree
|
|
131
131
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-repository-provider",
|
|
3
|
-
"version": "7.25.
|
|
3
|
+
"version": "7.25.58",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"content-entry": "^4.1.9",
|
|
34
34
|
"fetch-link-util": "^1.0.7",
|
|
35
|
-
"fetch-rate-limit-util": "^2.4.
|
|
35
|
+
"fetch-rate-limit-util": "^2.4.11",
|
|
36
36
|
"matching-iterator": "^2.0.3",
|
|
37
37
|
"node-fetch": "^3.2.3",
|
|
38
38
|
"one-time-execution-method": "^2.0.13",
|
package/src/github-branch.mjs
CHANGED
|
@@ -140,10 +140,24 @@ export class GithubBranch extends Branch {
|
|
|
140
140
|
* @return {Object[]}
|
|
141
141
|
*/
|
|
142
142
|
async tree(sha) {
|
|
143
|
+
if (this._tree) {
|
|
144
|
+
const tree = this._tree.get(sha);
|
|
145
|
+
if (tree) {
|
|
146
|
+
return tree;
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
this._tree = new Map();
|
|
150
|
+
}
|
|
151
|
+
|
|
143
152
|
const { json } = await this.provider.fetchJSON(
|
|
144
153
|
`repos/${this.slug}/git/trees/${sha}?recursive=1`
|
|
145
154
|
);
|
|
146
|
-
|
|
155
|
+
|
|
156
|
+
const tree = json.tree;
|
|
157
|
+
|
|
158
|
+
this._tree.set(sha, tree);
|
|
159
|
+
|
|
160
|
+
return tree;
|
|
147
161
|
}
|
|
148
162
|
|
|
149
163
|
async *entries(patterns) {
|