🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@allurereport/core-api

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@allurereport/core-api - npm Package Compare versions

Comparing version
3.8.0
to
3.8.1
+1
-0
dist/utils/history.d.ts

@@ -8,4 +8,5 @@ import type { HistoryDataPoint, HistoryTestResult } from "../history.js";

export declare const filterUnknownByKnownIssues: (trs: TestResult[], knownIssueHistoryIds: ReadonlySet<string>) => TestResult[];
export declare const normalizeHistoryDataPoint: (historyDataPoint: HistoryDataPoint) => HistoryDataPoint;
export declare const normalizeHistoryDataPointUrls: (historyDataPoint: HistoryDataPoint) => HistoryDataPoint;
export declare const selectHistoryTestResults: (historyDataPoints: HistoryDataPoint[], historyIdCandidates: readonly string[]) => HistoryTestResult[];
export declare const htrsByTr: (hdps: HistoryDataPoint[], tr: TestResult | HistoryTestResult) => HistoryTestResult[];
+25
-10

@@ -5,2 +5,9 @@ import { createHash } from "node:crypto";

const md5 = (data) => createHash("md5").update(data).digest("hex");
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
const normalizeHistoryTestResults = (testResults) => {
if (!isRecord(testResults)) {
return {};
}
return Object.fromEntries(Object.entries(testResults).filter(([, value]) => isRecord(value)));
};
const parametersCompare = (a, b) => {

@@ -43,14 +50,22 @@ return (a.name ?? "").localeCompare(b.name ?? "") || (a.value ?? "").localeCompare(b.value ?? "");

};
export const normalizeHistoryDataPoint = (historyDataPoint) => ({
...historyDataPoint,
knownTestCaseIds: Array.isArray(historyDataPoint.knownTestCaseIds) ? historyDataPoint.knownTestCaseIds : [],
testResults: normalizeHistoryTestResults(historyDataPoint.testResults),
metrics: isRecord(historyDataPoint.metrics) ? historyDataPoint.metrics : {},
url: historyDataPoint.url ?? "",
});
export const normalizeHistoryDataPointUrls = (historyDataPoint) => {
const { url } = historyDataPoint;
const normalizedHistoryDataPoint = normalizeHistoryDataPoint(historyDataPoint);
const { url } = normalizedHistoryDataPoint;
if (!url) {
return historyDataPoint;
return normalizedHistoryDataPoint;
}
let testResults = historyDataPoint.testResults;
for (const [historyId, historyTestResult] of Object.entries(historyDataPoint.testResults)) {
let testResults = normalizedHistoryDataPoint.testResults;
for (const [historyId, historyTestResult] of Object.entries(normalizedHistoryDataPoint.testResults)) {
if (historyTestResult.url) {
continue;
}
if (testResults === historyDataPoint.testResults) {
testResults = { ...historyDataPoint.testResults };
if (testResults === normalizedHistoryDataPoint.testResults) {
testResults = { ...normalizedHistoryDataPoint.testResults };
}

@@ -62,7 +77,7 @@ testResults[historyId] = {

}
if (testResults === historyDataPoint.testResults) {
return historyDataPoint;
if (testResults === normalizedHistoryDataPoint.testResults) {
return normalizedHistoryDataPoint;
}
return {
...historyDataPoint,
...normalizedHistoryDataPoint,
testResults,

@@ -77,3 +92,3 @@ };

for (const historyId of historyIdCandidates) {
const historyTestResult = historyDataPoint.testResults[historyId];
const historyTestResult = historyDataPoint.testResults?.[historyId];
if (!historyTestResult) {

@@ -80,0 +95,0 @@ continue;

{
"name": "@allurereport/core-api",
"version": "3.8.0",
"version": "3.8.1",
"description": "Allure Core API",

@@ -5,0 +5,0 @@ "keywords": [