@argos-ci/core 4.1.0 → 4.1.1

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/dist/index.js +13 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -587,6 +587,15 @@ var mustBeArgosToken = (value) => {
587
587
  throw new Error("Invalid Argos repository token (must be 40 characters)");
588
588
  }
589
589
  };
590
+ var minNumber = (value, min) => {
591
+ const number = parseInt(value, 10);
592
+ if (!Number.isInteger(number)) {
593
+ throw new Error("must be a number");
594
+ }
595
+ if (number < min) {
596
+ throw new Error(`must be at least ${min}`);
597
+ }
598
+ };
590
599
  convict.addFormat({
591
600
  name: "float-percent",
592
601
  validate: function(val) {
@@ -662,15 +671,15 @@ var schema = {
662
671
  },
663
672
  parallelIndex: {
664
673
  env: "ARGOS_PARALLEL_INDEX",
665
- format: "nat",
666
674
  default: null,
667
- nullable: true
675
+ nullable: true,
676
+ format: (value) => minNumber(value, 1)
668
677
  },
669
678
  parallelTotal: {
670
679
  env: "ARGOS_PARALLEL_TOTAL",
671
- format: "int",
672
680
  default: null,
673
- nullable: true
681
+ nullable: true,
682
+ format: (value) => minNumber(value, -1)
674
683
  },
675
684
  referenceBranch: {
676
685
  env: "ARGOS_REFERENCE_BRANCH",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/core",
3
3
  "description": "Node.js SDK for visual testing with Argos.",
4
- "version": "4.1.0",
4
+ "version": "4.1.1",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "exports": {
@@ -64,5 +64,5 @@
64
64
  "lint": "eslint .",
65
65
  "test": "vitest"
66
66
  },
67
- "gitHead": "74818a1d3fe21574d0884c828ee709e62605d974"
67
+ "gitHead": "7cbf27f8eb0415089d827759d9e14deaf891f797"
68
68
  }