repository-provider 32.6.8 → 32.6.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "32.6.8",
3
+ "version": "32.6.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,10 +34,10 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "ava": "^5.2.0",
37
- "browser-ava": "^1.3.25",
37
+ "browser-ava": "^1.3.26",
38
38
  "c8": "^7.13.0",
39
39
  "documentation": "^14.0.1",
40
- "repository-provider-test-support": "^2.2.37",
40
+ "repository-provider-test-support": "^2.2.38",
41
41
  "semantic-release": "^20.1.1",
42
42
  "typescript": "^4.9.5"
43
43
  },
@@ -171,6 +171,15 @@ export class BaseProvider extends BaseObject {
171
171
  return [this.name + ":"];
172
172
  }
173
173
 
174
+ /**
175
+ * Does the provider support the base name.
176
+ * @param {string} base to be checked
177
+ * @return {boolean} true if base is supported or base is undefined
178
+ */
179
+ supportsBase(base) {
180
+ return base === undefined || this.repositoryBases.indexOf(base) >= 0;
181
+ }
182
+
174
183
  /**
175
184
  * Bring a repository name into its normal form by removing any clutter.
176
185
  * like .git suffix or #branch names.
@@ -217,25 +226,6 @@ export class BaseProvider extends BaseObject {
217
226
  return true;
218
227
  }
219
228
 
220
- /**
221
- * Does the provider support the base name.
222
- * @param {string} base to be checked
223
- * @return {boolean} true if base is supported or base is undefined
224
- */
225
- supportsBase(base) {
226
- if (base === undefined) {
227
- return true;
228
- }
229
-
230
- for (const b of this.repositoryBases) {
231
- if (b === base) {
232
- return true;
233
- }
234
- }
235
-
236
- return false;
237
- }
238
-
239
229
  /**
240
230
  * Parses repository name and tries to split it into
241
231
  * base, group, repository and branch.
@@ -164,8 +164,7 @@ export function RepositoryOwner(base) {
164
164
 
165
165
  _addRepository(repository)
166
166
  {
167
- const normalizedName = this.normalizeRepositoryName(repository.name, true);
168
- this.#repositories.set(normalizedName, repository);
167
+ this.#repositories.set(this.normalizeRepositoryName(repository.name, true), repository);
169
168
  }
170
169
 
171
170
  /**