repository-provider 36.1.9 → 37.0.0

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.
Files changed (2) hide show
  1. package/package.json +9 -9
  2. package/src/repository.mjs +16 -19
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "36.1.9",
3
+ "version": "37.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
7
7
  },
8
- "packageManager": "npm@11.10.0+sha512.8bc844e37892200305b98562f13c6c10849d10b3387c8cdaeb4d1a2e32746a79063cba9dd284cf28c26a01c3bf4169b7d3b31b4a5586cc970d6749463108073c",
8
+ "packageManager": "npm@11.13.0",
9
9
  "exports": {
10
10
  ".": {
11
11
  "default": "./src/index.mjs"
@@ -34,19 +34,19 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "content-entry": "^14.2.7",
37
- "matching-iterator": "^2.1.6",
38
- "pacc": "^9.2.4"
37
+ "matching-iterator": "^2.1.7",
38
+ "pacc": "^9.2.7"
39
39
  },
40
40
  "devDependencies": {
41
- "ava": "^6.4.1",
42
- "browser-ava": "^2.3.53",
43
- "c8": "^10.1.3",
41
+ "ava": "^8.0.0",
42
+ "browser-ava": "^2.3.57",
43
+ "c8": "^11.0.0",
44
44
  "documentation": "^14.0.3",
45
- "repository-provider-test-support": "^5.0.12",
45
+ "repository-provider-test-support": "^5.0.15",
46
46
  "semantic-release": "^25.0.3"
47
47
  },
48
48
  "engines": {
49
- "node": ">=24.12.0"
49
+ "node": ">=26.1.0"
50
50
  },
51
51
  "repository": {
52
52
  "type": "git",
@@ -324,8 +324,8 @@ export class Repository extends OwnedObject {
324
324
  }
325
325
 
326
326
  /**
327
- *
328
- * @param {Tag} tag
327
+ *
328
+ * @param {Tag} tag
329
329
  */
330
330
  _addTag(tag) {
331
331
  this.#tags.set(tag.name, tag);
@@ -351,18 +351,15 @@ export class Repository extends OwnedObject {
351
351
  * @return {PullRequest}
352
352
  */
353
353
  addPullRequest(name, source, options) {
354
- let pr = this.#pullRequests.get(name);
355
- if (pr === undefined) {
356
- // @ts-ignore
357
- pr = new this.pullRequestClass(name, source, this, options);
358
- this.#pullRequests.set(pr.name, pr);
359
- }
360
- return pr;
354
+ return this.#pullRequests.getOrInsertComputed(
355
+ name,
356
+ () => new this.pullRequestClass(name, source, this, options)
357
+ );
361
358
  }
362
359
 
363
360
  /**
364
- *
365
- * @param {PullRequest} pr
361
+ *
362
+ * @param {PullRequest} pr
366
363
  */
367
364
  _addPullRequest(pr) {
368
365
  this.#pullRequests.set(pr.name, pr);
@@ -414,8 +411,8 @@ export class Repository extends OwnedObject {
414
411
  }
415
412
 
416
413
  /**
417
- *
418
- * @param {Hook} hook
414
+ *
415
+ * @param {Hook} hook
419
416
  */
420
417
  _addHook(hook) {
421
418
  this.#hooks.push(hook);
@@ -456,8 +453,8 @@ export class Repository extends OwnedObject {
456
453
  }
457
454
 
458
455
  /**
459
- *
460
- * @param {Milestone} milestone
456
+ *
457
+ * @param {Milestone} milestone
461
458
  */
462
459
  _addMilestone(milestone) {
463
460
  this.#milestones.set(milestone.name, milestone);
@@ -473,8 +470,8 @@ export class Repository extends OwnedObject {
473
470
  }
474
471
 
475
472
  /**
476
- *
477
- * @param {Project} project
473
+ *
474
+ * @param {Project} project
478
475
  */
479
476
  _addProject(project) {
480
477
  this.#projects.set(project.name, project);
@@ -490,8 +487,8 @@ export class Repository extends OwnedObject {
490
487
  }
491
488
 
492
489
  /**
493
- *
494
- * @param {Application} application
490
+ *
491
+ * @param {Application} application
495
492
  */
496
493
  _addApplication(application) {
497
494
  this.#applications.set(application.name, application);