npm-update-package 1.2.1 → 1.2.2

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -43,7 +43,7 @@
43
43
  "@types/parse-github-url": "1.0.0",
44
44
  "@types/semver": "7.3.9",
45
45
  "@typescript-eslint/eslint-plugin": "5.25.0",
46
- "eslint": "8.15.0",
46
+ "eslint": "8.16.0",
47
47
  "eslint-config-lodash": "1.1.0",
48
48
  "eslint-config-standard-with-typescript": "21.0.1",
49
49
  "eslint-plugin-eslint-comments": "3.2.0",
@@ -4,18 +4,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AssigneesAdder = void 0;
7
- const shuffle_1 = __importDefault(require("lodash/shuffle"));
7
+ const sampleSize_1 = __importDefault(require("lodash/sampleSize"));
8
8
  class AssigneesAdder {
9
9
  constructor({ github, gitRepo }) {
10
10
  this.github = github;
11
11
  this.gitRepo = gitRepo;
12
12
  }
13
- async add({ issueNumber, assignees, sampleSize }) {
13
+ async add({ issueNumber, assignees, size }) {
14
14
  await this.github.addAssignees({
15
15
  owner: this.gitRepo.owner,
16
16
  repo: this.gitRepo.name,
17
17
  issueNumber,
18
- assignees: sampleSize !== undefined ? (0, shuffle_1.default)(assignees).slice(0, sampleSize) : assignees
18
+ assignees: size !== undefined ? (0, sampleSize_1.default)(assignees, size) : assignees
19
19
  });
20
20
  }
21
21
  }
@@ -37,14 +37,14 @@ class PullRequestCreator {
37
37
  await this.assigneesAdder.add({
38
38
  issueNumber: pullRequest.number,
39
39
  assignees: this.options.assignees,
40
- sampleSize: this.options.assigneesSampleSize
40
+ size: this.options.assigneesSampleSize
41
41
  });
42
42
  }
43
43
  if (this.options.reviewers !== undefined) {
44
44
  await this.reviewersAdder.add({
45
45
  pullNumber: pullRequest.number,
46
46
  reviewers: this.options.reviewers,
47
- sampleSize: this.options.reviewersSampleSize
47
+ size: this.options.reviewersSampleSize
48
48
  });
49
49
  }
50
50
  return pullRequest;
@@ -4,18 +4,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ReviewersAdder = void 0;
7
- const shuffle_1 = __importDefault(require("lodash/shuffle"));
7
+ const sampleSize_1 = __importDefault(require("lodash/sampleSize"));
8
8
  class ReviewersAdder {
9
9
  constructor({ github, gitRepo }) {
10
10
  this.github = github;
11
11
  this.gitRepo = gitRepo;
12
12
  }
13
- async add({ pullNumber, reviewers, sampleSize }) {
13
+ async add({ pullNumber, reviewers, size }) {
14
14
  await this.github.requestReviewers({
15
15
  owner: this.gitRepo.owner,
16
16
  repo: this.gitRepo.name,
17
17
  pullNumber,
18
- reviewers: sampleSize !== undefined ? (0, shuffle_1.default)(reviewers).slice(0, sampleSize) : reviewers
18
+ reviewers: size !== undefined ? (0, sampleSize_1.default)(reviewers, size) : reviewers
19
19
  });
20
20
  }
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -43,7 +43,7 @@
43
43
  "@types/parse-github-url": "1.0.0",
44
44
  "@types/semver": "7.3.9",
45
45
  "@typescript-eslint/eslint-plugin": "5.25.0",
46
- "eslint": "8.15.0",
46
+ "eslint": "8.16.0",
47
47
  "eslint-config-lodash": "1.1.0",
48
48
  "eslint-config-standard-with-typescript": "21.0.1",
49
49
  "eslint-plugin-eslint-comments": "3.2.0",