repository-provider 32.7.12 → 32.7.13

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.7.12",
3
+ "version": "32.7.13",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -10,7 +10,6 @@ import { asArray, stripBaseName, stripBaseNames } from "./util.mjs";
10
10
  */
11
11
  export function RepositoryOwner(base) {
12
12
  return class RepositoryOwner extends base {
13
-
14
13
  #repositories = new Map();
15
14
 
16
15
  /**
@@ -21,7 +20,10 @@ export function RepositoryOwner(base) {
21
20
  * @return {string} normalized name
22
21
  */
23
22
  normalizeRepositoryName(name, forLookup) {
24
- name = name.replace(/#.*$/, "");
23
+ const i = name.indexOf("#");
24
+ if (i >= 0) {
25
+ name = name.substring(0, i);
26
+ }
25
27
 
26
28
  const parts = name.split(/\//);
27
29
  if (parts.length >= 2) {
@@ -160,12 +162,17 @@ export function RepositoryOwner(base) {
160
162
  * @return {Promise<Repository>} newly created repository
161
163
  */
162
164
  addRepository(name, options) {
163
- return this.#repositories.get(this.normalizeRepositoryName(name, true)) || new this.repositoryClass(this, name, options);
165
+ return (
166
+ this.#repositories.get(this.normalizeRepositoryName(name, true)) ||
167
+ new this.repositoryClass(this, name, options)
168
+ );
164
169
  }
165
170
 
166
- _addRepository(repository)
167
- {
168
- this.#repositories.set(this.normalizeRepositoryName(repository.name, true), repository);
171
+ _addRepository(repository) {
172
+ this.#repositories.set(
173
+ this.normalizeRepositoryName(repository.name, true),
174
+ repository
175
+ );
169
176
  }
170
177
 
171
178
  /**