Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@metlo/testing

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metlo/testing - npm Package Compare versions

Comparing version 0.2.9 to 0.2.10

33

dist/generate/sample-request.js

@@ -86,2 +86,30 @@ "use strict";

};
const getRecentTraceHash = (traceHash) => {
let res = {
hash: null,
timestamp: null,
};
for (const hash in traceHash) {
if (!res.timestamp || traceHash[hash] > res.timestamp) {
res.hash = hash;
res.timestamp = traceHash[hash];
}
}
return res;
};
const getDataFieldInfo = (dataFields) => {
let contentType = dataFields[0].contentType;
let traceHash = getRecentTraceHash(dataFields[0].traceHash);
for (const dataField of dataFields) {
const currTraceHash = getRecentTraceHash(dataField.traceHash);
if (dataField.contentType &&
(currTraceHash === null || currTraceHash === void 0 ? void 0 : currTraceHash.timestamp) &&
(traceHash === null || traceHash === void 0 ? void 0 : traceHash.timestamp) &&
(currTraceHash === null || currTraceHash === void 0 ? void 0 : currTraceHash.timestamp) > (traceHash === null || traceHash === void 0 ? void 0 : traceHash.timestamp)) {
traceHash = Object.assign({}, currTraceHash);
contentType = dataField.contentType;
}
}
return { contentType, traceHash };
};
const addBodyToRequest = (gen, ctx) => {

@@ -94,4 +122,5 @@ var _a, _b;

}
const contentType = dataFields[0].contentType;
const filteredDataFields = dataFields.filter(e => e.contentType == contentType);
const { contentType, traceHash } = getDataFieldInfo(dataFields);
const filteredDataFields = dataFields.filter(e => e.contentType == contentType &&
(!traceHash.hash || e.traceHash[traceHash.hash]));
let body = undefined;

@@ -98,0 +127,0 @@ for (const dataField of filteredDataFields) {

@@ -11,2 +11,3 @@ import { z } from "zod";

dataType: DataType;
traceHash: Record<string, number>;
}

@@ -13,0 +14,0 @@ export interface GenTestEndpointAuthConfig {

2

package.json
{
"name": "@metlo/testing",
"version": "0.2.9",
"version": "0.2.10",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc