@argos-ci/util 2.2.2 → 2.3.1-alpha.3

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/browser.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  type ScreenshotMetadata = {
2
2
  url?: string;
3
+ previewUrl?: string;
3
4
  viewport?: {
4
5
  width: number;
5
6
  height: number;
package/dist/browser.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  getMetadataPath,
3
3
  getScreenshotName,
4
4
  validateThreshold
5
- } from "./chunk-SBIRPBRC.js";
5
+ } from "./chunk-VMM7XHBS.js";
6
6
  export {
7
7
  getMetadataPath,
8
8
  getScreenshotName,
@@ -0,0 +1,26 @@
1
+ // src/metadata.ts
2
+ function getMetadataPath(screenshotPath) {
3
+ return screenshotPath + ".argos.json";
4
+ }
5
+
6
+ // src/name.ts
7
+ function getScreenshotName(name, options = {}) {
8
+ const parts = [name];
9
+ if (options.viewportWidth) {
10
+ parts.push(`vw-${options.viewportWidth}`);
11
+ }
12
+ return parts.join(" ");
13
+ }
14
+
15
+ // src/threshold.ts
16
+ function validateThreshold(threshold) {
17
+ if (threshold < 0 || threshold > 1) {
18
+ throw new Error("The threshold must be between 0 and 1.");
19
+ }
20
+ }
21
+
22
+ export {
23
+ getMetadataPath,
24
+ getScreenshotName,
25
+ validateThreshold
26
+ };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  getMetadataPath,
3
3
  getScreenshotName,
4
4
  validateThreshold
5
- } from "./chunk-SBIRPBRC.js";
5
+ } from "./chunk-VMM7XHBS.js";
6
6
 
7
7
  // src/git.ts
8
8
  import { exec } from "node:child_process";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@argos-ci/util",
3
3
  "description": "Set of utilities used across all Argos SDKs.",
4
- "version": "2.2.2",
4
+ "version": "2.3.1-alpha.3+d98d368",
5
5
  "author": "Smooth Code",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "@types/node": "^18.19.44"
45
45
  },
46
- "gitHead": "0c91306ae0cb8bec5ef93db79565635e405086f7"
46
+ "gitHead": "d98d368f95bee0eff3bd70ce945daf883f37f2d4"
47
47
  }