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

graphql-js-tree

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-js-tree - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

4

lib/TreeOperations/tree.d.ts
import { ParserField, ParserTree, Value } from "../Models";
export declare const mutate: (tree: ParserTree, allNodes: ParserField[]) => {
updateFieldOnNode: (node: ParserField, i: number, updatedField: ParserField, parentNode?: string) => void;
addFieldToNode: (node: ParserField, f: ParserField) => void;
addFieldToNode: (node: ParserField, f: ParserField, parentNode?: string) => void;
renameRootNode: (node: ParserField, newName: string) => void;
removeNode: (node: ParserField) => void;
removeNode: (node: ParserField, parentNode?: string) => void;
implementInterface: (node: ParserField, interfaceNode: ParserField) => void;

@@ -8,0 +8,0 @@ deImplementInterface: (node: ParserField, interfaceName: string) => void;

@@ -22,3 +22,3 @@ "use strict";

};
const deleteFieldFromNode = (n, i) => {
const deleteFieldFromNode = (n, i, parentNode) => {
if (n.data.type === Models_1.TypeDefinition.InterfaceTypeDefinition) {

@@ -42,3 +42,3 @@ const argName = n.args[i].name;

(0, shared_2.regenerateId)(n);
mutateParentIfField(n);
mutateParentIfField(n, parentNode);
};

@@ -59,3 +59,3 @@ const updateFieldOnNode = (node, i, updatedField, parentNode) => {

};
const addFieldToNode = (node, f) => {
const addFieldToNode = (node, f, parentNode) => {
var _a;

@@ -67,3 +67,3 @@ (_a = node.args) === null || _a === void 0 ? void 0 : _a.push(Object.assign({}, f));

(0, shared_2.regenerateId)(node);
mutateParentIfField(node);
mutateParentIfField(node, parentNode);
};

@@ -99,3 +99,3 @@ const renameRootNode = (node, newName) => {

};
const removeNode = (node) => {
const removeNode = (node, parentNode) => {
if (node.data.type === Models_1.TypeSystemDefinition.FieldDefinition) {

@@ -105,3 +105,3 @@ const parent = allNodes.find((parentNode) => parentNode.args.includes(node));

const index = parent.args.indexOf(node);
deleteFieldFromNode(parent, index);
deleteFieldFromNode(parent, index, parentNode);
}

@@ -114,3 +114,3 @@ return;

const index = parent.args.indexOf(node);
deleteFieldFromNode(parent, index);
deleteFieldFromNode(parent, index, parentNode);
}

@@ -126,3 +126,3 @@ return;

const index = parent.args.indexOf(node);
deleteFieldFromNode(parent, index);
deleteFieldFromNode(parent, index, parentNode);
}

@@ -134,3 +134,3 @@ else {

const fieldIndex = field.args.findIndex((f) => f === node);
deleteFieldFromNode(field, fieldIndex);
deleteFieldFromNode(field, fieldIndex, parentNode);
}

@@ -144,3 +144,3 @@ }

const index = parent.args.indexOf(node);
deleteFieldFromNode(parent, index);
deleteFieldFromNode(parent, index, parentNode);
}

@@ -147,0 +147,0 @@ return;

{
"name": "graphql-js-tree",
"version": "3.0.0",
"version": "3.0.1",
"private": false,

@@ -5,0 +5,0 @@ "license": "MIT",

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