repository-provider 32.7.10 → 32.7.11

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.10",
3
+ "version": "32.7.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,7 +37,7 @@
37
37
  "browser-ava": "^1.3.38",
38
38
  "c8": "^7.13.0",
39
39
  "documentation": "^14.0.1",
40
- "repository-provider-test-support": "^2.3.2",
40
+ "repository-provider-test-support": "^2.3.3",
41
41
  "semantic-release": "^21.0.2",
42
42
  "typescript": "^5.0.4"
43
43
  },
@@ -90,7 +90,7 @@ export class MultiGroupProvider extends BaseProvider {
90
90
  * Create a new repository group.
91
91
  * If there is already a group for the given name it will be returend instead
92
92
  * @param {string} name of the group
93
- * @param {Object} options
93
+ * @param {Object|undefined} options
94
94
  * @return {Promise<RepositoryGroup>}
95
95
  */
96
96
  async createRepositoryGroup(name, options) {
@@ -100,7 +100,7 @@ export class MultiGroupProvider extends BaseProvider {
100
100
  /**
101
101
  * Add a new repository group (not provider specific actions are executed).
102
102
  * @param {string} name of the group
103
- * @param {Object} options
103
+ * @param {Object|undefined} options
104
104
  * @return {RepositoryGroup}
105
105
  */
106
106
  addRepositoryGroup(name, options) {
@@ -9,8 +9,8 @@ import {
9
9
  /**
10
10
  * Object with a name.
11
11
  * @param {string} name
12
- * @param {Object} options
13
- * @param {Object} additionalProperties
12
+ * @param {Object|undefined} options
13
+ * @param {Object|undefined} additionalProperties
14
14
  *
15
15
  * @property {string} name
16
16
  */
package/src/ref.mjs CHANGED
@@ -70,7 +70,7 @@ export class Ref extends OwnedObject {
70
70
  /**
71
71
  * Get exactly one matching entry by name or undefine if no such entry is found.
72
72
  * @param {string} name
73
- * @return {Promise<ContentEntry>}
73
+ * @return {Promise<ContentEntry|undefined>}
74
74
  */
75
75
  async maybeEntry(name) {
76
76
  return (await this.entries(name).next()).value;
@@ -11,7 +11,7 @@ import {
11
11
  * Abstract repository collection.
12
12
  * @param {BaseProvider} provider
13
13
  * @param {string} name of the group
14
- * @param {Object} options
14
+ * @param {Object|undefined} options
15
15
  * @param {string} [options.description] human readable description
16
16
  * @param {string} [options.id] internal id
17
17
  * @param {string} [options.uuid] internal id
@@ -108,7 +108,7 @@ export class Repository extends OwnedObject {
108
108
 
109
109
  /**
110
110
  * List entries of the default branch.
111
- * @param {string[]} matchingPatterns
111
+ * @param {string[]|string} matchingPatterns
112
112
  * @return {AsyncIterator<ContentEntry>} all matching entries in the branch
113
113
  */
114
114
  async *entries(matchingPatterns) {
@@ -126,7 +126,7 @@ export class Repository extends OwnedObject {
126
126
 
127
127
  /**
128
128
  * List commits of the default branch.
129
- * @param {Object} options
129
+ * @param {Object|undefined} options
130
130
  * @return {AsyncIterator<Commit>} all matching commits in the repository
131
131
  */
132
132
  async *commits(options) {}
@@ -207,7 +207,7 @@ export class Repository extends OwnedObject {
207
207
  /**
208
208
  * Lookup branch by name.
209
209
  * @param {string} name
210
- * @return {Promise<Branch>}
210
+ * @return {Promise<Branch|undefined>}
211
211
  */
212
212
  async branch(name) {
213
213
  if (name === this.defaultBranchName) {
@@ -226,6 +226,7 @@ export class Repository extends OwnedObject {
226
226
  }
227
227
 
228
228
  /**
229
+ * @param {string[]|string} patterns
229
230
  * @return {AsyncIterator<Branch>} of all branches
230
231
  */
231
232
  async *branches(patterns) {
@@ -239,7 +240,7 @@ export class Repository extends OwnedObject {
239
240
  * Create a new {@link Branch} by cloning a given source branch.
240
241
  * @param {string} name of the new branch
241
242
  * @param {Branch} source branch defaults to the defaultBranch
242
- * @param {Object} options
243
+ * @param {Object|undefined} options
243
244
  * @return {Promise<Branch>} newly created branch (or already present old one with the same name)
244
245
  */
245
246
  async createBranch(name, source, options) {
@@ -291,7 +292,7 @@ export class Repository extends OwnedObject {
291
292
  }
292
293
 
293
294
  /**
294
- * @param {string|string[]} patterns
295
+ * @param {string[]|string} patterns
295
296
  * @return {AsyncIterator<Tag>} of all tags
296
297
  */
297
298
  async *tags(patterns) {
@@ -333,7 +334,7 @@ export class Repository extends OwnedObject {
333
334
  * Add a pull request.
334
335
  * @param {string} name
335
336
  * @param {Branch} source
336
- * @param {Object} options
337
+ * @param {Object|undefined} options
337
338
  * @return {PullRequest}
338
339
  */
339
340
  addPullRequest(name, source, options) {
@@ -364,7 +365,7 @@ export class Repository extends OwnedObject {
364
365
  /**
365
366
  * The @see {@link PullRequest} for a given name.
366
367
  * @param {string} name
367
- * @return {Promise<PullRequest>}
368
+ * @return {Promise<PullRequest|undefined>}
368
369
  */
369
370
  async pullRequest(name) {
370
371
  await this.initializePullRequests();
@@ -383,7 +384,7 @@ export class Repository extends OwnedObject {
383
384
  /**
384
385
  * Add a new {@link Hook}.
385
386
  * @param {string} name of the new hoook name
386
- * @param {Object} options
387
+ * @param {Object|undefined} options
387
388
  * @return {Hook} newly created hook
388
389
  */
389
390
  addHook(name, options) {
@@ -434,6 +435,11 @@ export class Repository extends OwnedObject {
434
435
  this.#milestones.set(milestone.name, milestone);
435
436
  }
436
437
 
438
+ /**
439
+ * Get a Milestone.
440
+ * @param {string} name
441
+ * @return {Promise<Milestone|undefined>} for the given name
442
+ */
437
443
  async milestone(name) {
438
444
  return this.#milestones.get(name);
439
445
  }
@@ -442,6 +448,11 @@ export class Repository extends OwnedObject {
442
448
  this.#projects.set(project.name, project);
443
449
  }
444
450
 
451
+ /**
452
+ * Get a Project.
453
+ * @param {string} name
454
+ * @return {Promise<Project|undefined>} for the given name
455
+ */
445
456
  async project(name) {
446
457
  return this.#projects.get(name);
447
458
  }
@@ -450,6 +461,11 @@ export class Repository extends OwnedObject {
450
461
  this.#applications.set(application.name, application);
451
462
  }
452
463
 
464
+ /**
465
+ * Get an Application.
466
+ * @param {string} name
467
+ * @return {Promise<Application|undefined>} for the given name
468
+ */
453
469
  async application(name) {
454
470
  return this.#applications.get(name);
455
471
  }
package/src/util.mjs CHANGED
@@ -19,6 +19,7 @@ export function asArray(value) {
19
19
  * @return {string} name without base
20
20
  */
21
21
  export function stripBaseName(name, repositoryBases, whenFound) {
22
+ if(name) {
22
23
  for (const b of repositoryBases) {
23
24
  const m = name.match(/^(\w+:)\/\/([^@]+@)/);
24
25
  if (m) {
@@ -30,12 +31,13 @@ export function stripBaseName(name, repositoryBases, whenFound) {
30
31
  return name.slice(b.length);
31
32
  }
32
33
  }
34
+ }
33
35
  return name;
34
36
  }
35
37
 
36
38
  /**
37
39
  * Loops over names and executes stripBaseName.
38
- * @param {string|string[]} names
40
+ * @param {string[]|string|undefined} names
39
41
  * @param {string[]} repositoryBases all possible bases
40
42
  * @param {Function} [whenFound] to be called with the found base name
41
43
  * @return {string[]|string|undefined} names without base
@@ -43,7 +45,7 @@ export function stripBaseName(name, repositoryBases, whenFound) {
43
45
  export function stripBaseNames(names, repositoryBases, whenFound) {
44
46
  return Array.isArray(names)
45
47
  ? names.map(name => stripBaseName(name, repositoryBases, whenFound))
46
- : names && stripBaseName(names, repositoryBases, whenFound);
48
+ : stripBaseName(names, repositoryBases, whenFound);
47
49
  }
48
50
 
49
51
  /**