@riddledc/riddle-proof 0.7.151 → 0.7.152
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/cli.cjs +17 -3
- package/dist/cli.js +17 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -15118,6 +15118,20 @@ function profileCheckTextTarget(evidence) {
|
|
|
15118
15118
|
const pattern = cliString(evidence.pattern);
|
|
15119
15119
|
return pattern ? `pattern ${markdownInlineCode(pattern)}` : void 0;
|
|
15120
15120
|
}
|
|
15121
|
+
function observeWithinMarkdownReceipt(evidence) {
|
|
15122
|
+
const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
|
|
15123
|
+
if (!viewports.length) return void 0;
|
|
15124
|
+
const receipts = viewports.slice(0, 4).map((viewport) => {
|
|
15125
|
+
const name = cliString(viewport.viewport) || cliString(viewport.name) || "viewport";
|
|
15126
|
+
const matched = viewport.matched === true ? "matched" : viewport.matched === false ? "missed" : "observed";
|
|
15127
|
+
const elapsedMs3 = cliFiniteNumber(viewport.elapsed_ms);
|
|
15128
|
+
const attempts = cliFiniteNumber(viewport.attempts);
|
|
15129
|
+
const sample = cliString(viewport.sample);
|
|
15130
|
+
return `${name} ${matched}${elapsedMs3 === void 0 ? "" : ` in ${elapsedMs3}ms`}${attempts === void 0 ? "" : `, ${attempts} attempt${attempts === 1 ? "" : "s"}`}${sample ? `, sample ${markdownInlineCode(sample, 70)}` : ""}`;
|
|
15131
|
+
});
|
|
15132
|
+
if (viewports.length > receipts.length) receipts.push(`${viewports.length - receipts.length} more viewport${viewports.length - receipts.length === 1 ? "" : "s"}`);
|
|
15133
|
+
return receipts.join("; ");
|
|
15134
|
+
}
|
|
15121
15135
|
function profileCheckMarkdownTarget(check) {
|
|
15122
15136
|
const evidence = cliRecord(check.evidence);
|
|
15123
15137
|
if (!evidence) return void 0;
|
|
@@ -15151,9 +15165,9 @@ function profileCheckMarkdownTarget(check) {
|
|
|
15151
15165
|
const textTarget = profileCheckTextTarget(evidence);
|
|
15152
15166
|
const timeoutMs = cliFiniteNumber(evidence.timeout_ms);
|
|
15153
15167
|
const withinLabel = timeoutMs === void 0 ? "within timeout" : `within ${timeoutMs}ms`;
|
|
15154
|
-
|
|
15155
|
-
|
|
15156
|
-
return
|
|
15168
|
+
const receipt = observeWithinMarkdownReceipt(evidence);
|
|
15169
|
+
const base = selector && textTarget ? `${markdownInlineCode(selector)} observes ${textTarget} ${withinLabel}` : selector ? `${markdownInlineCode(selector)} visible ${withinLabel}` : textTarget ? `${textTarget} ${withinLabel}` : withinLabel;
|
|
15170
|
+
return receipt ? `${base}; ${receipt}` : base;
|
|
15157
15171
|
}
|
|
15158
15172
|
if (check.type === "text_visible" || check.type === "text_absent") {
|
|
15159
15173
|
return profileCheckTextTarget(evidence);
|
package/dist/cli.js
CHANGED
|
@@ -485,6 +485,20 @@ function profileCheckTextTarget(evidence) {
|
|
|
485
485
|
const pattern = cliString(evidence.pattern);
|
|
486
486
|
return pattern ? `pattern ${markdownInlineCode(pattern)}` : void 0;
|
|
487
487
|
}
|
|
488
|
+
function observeWithinMarkdownReceipt(evidence) {
|
|
489
|
+
const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
|
|
490
|
+
if (!viewports.length) return void 0;
|
|
491
|
+
const receipts = viewports.slice(0, 4).map((viewport) => {
|
|
492
|
+
const name = cliString(viewport.viewport) || cliString(viewport.name) || "viewport";
|
|
493
|
+
const matched = viewport.matched === true ? "matched" : viewport.matched === false ? "missed" : "observed";
|
|
494
|
+
const elapsedMs = cliFiniteNumber(viewport.elapsed_ms);
|
|
495
|
+
const attempts = cliFiniteNumber(viewport.attempts);
|
|
496
|
+
const sample = cliString(viewport.sample);
|
|
497
|
+
return `${name} ${matched}${elapsedMs === void 0 ? "" : ` in ${elapsedMs}ms`}${attempts === void 0 ? "" : `, ${attempts} attempt${attempts === 1 ? "" : "s"}`}${sample ? `, sample ${markdownInlineCode(sample, 70)}` : ""}`;
|
|
498
|
+
});
|
|
499
|
+
if (viewports.length > receipts.length) receipts.push(`${viewports.length - receipts.length} more viewport${viewports.length - receipts.length === 1 ? "" : "s"}`);
|
|
500
|
+
return receipts.join("; ");
|
|
501
|
+
}
|
|
488
502
|
function profileCheckMarkdownTarget(check) {
|
|
489
503
|
const evidence = cliRecord(check.evidence);
|
|
490
504
|
if (!evidence) return void 0;
|
|
@@ -518,9 +532,9 @@ function profileCheckMarkdownTarget(check) {
|
|
|
518
532
|
const textTarget = profileCheckTextTarget(evidence);
|
|
519
533
|
const timeoutMs = cliFiniteNumber(evidence.timeout_ms);
|
|
520
534
|
const withinLabel = timeoutMs === void 0 ? "within timeout" : `within ${timeoutMs}ms`;
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
return
|
|
535
|
+
const receipt = observeWithinMarkdownReceipt(evidence);
|
|
536
|
+
const base = selector && textTarget ? `${markdownInlineCode(selector)} observes ${textTarget} ${withinLabel}` : selector ? `${markdownInlineCode(selector)} visible ${withinLabel}` : textTarget ? `${textTarget} ${withinLabel}` : withinLabel;
|
|
537
|
+
return receipt ? `${base}; ${receipt}` : base;
|
|
524
538
|
}
|
|
525
539
|
if (check.type === "text_visible" || check.type === "text_absent") {
|
|
526
540
|
return profileCheckTextTarget(evidence);
|