New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@envelop/extended-validation

Package Overview
Dependencies
Maintainers
0
Versions
1304
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@envelop/extended-validation - npm Package Compare versions

Comparing version 4.1.0-alpha-20240806125641-9b9885ba to 4.1.0-alpha-20240810114324-912296f8

19

cjs/plugin.js

@@ -85,9 +85,18 @@ "use strict";

};
function visitPath(path, data = {}) {
let currentData = (data ||= typeof path[0] === 'number' ? [] : {});
for (const pathItemIndex in path.slice(0, -1)) {
const pathItem = path[pathItemIndex];
currentData = currentData[pathItem] ||=
typeof path[Number(pathItemIndex) + 1] === 'number' ? [] : {};
if (Array.isArray(currentData)) {
currentData = currentData.map((c, i) => visitPath(path.slice(Number(pathItemIndex) + 1), c));
}
}
currentData[path[path.length - 1]] = null;
return data;
}
errors.forEach(e => {
if (e.path?.length) {
let currentData = (newResult.data ||= {});
for (const pathItem of e.path.slice(0, -1)) {
currentData = currentData[pathItem] ||= {};
}
currentData[e.path[e.path.length - 1]] = null;
newResult.data = visitPath(e.path, newResult.data);
}

@@ -94,0 +103,0 @@ });

@@ -81,9 +81,18 @@ import { TypeInfo, ValidationContext, visit, visitInParallel, visitWithTypeInfo, } from 'graphql';

};
function visitPath(path, data = {}) {
let currentData = (data ||= typeof path[0] === 'number' ? [] : {});
for (const pathItemIndex in path.slice(0, -1)) {
const pathItem = path[pathItemIndex];
currentData = currentData[pathItem] ||=
typeof path[Number(pathItemIndex) + 1] === 'number' ? [] : {};
if (Array.isArray(currentData)) {
currentData = currentData.map((c, i) => visitPath(path.slice(Number(pathItemIndex) + 1), c));
}
}
currentData[path[path.length - 1]] = null;
return data;
}
errors.forEach(e => {
if (e.path?.length) {
let currentData = (newResult.data ||= {});
for (const pathItem of e.path.slice(0, -1)) {
currentData = currentData[pathItem] ||= {};
}
currentData[e.path[e.path.length - 1]] = null;
newResult.data = visitPath(e.path, newResult.data);
}

@@ -90,0 +99,0 @@ });

{
"name": "@envelop/extended-validation",
"version": "4.1.0-alpha-20240806125641-9b9885ba",
"version": "4.1.0-alpha-20240810114324-912296f8",
"sideEffects": false,

@@ -5,0 +5,0 @@ "peerDependencies": {

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