Socket
Socket
Sign inDemoInstall

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 0.2.7 to 0.2.8

lib/TreeOperations/directive.d.ts

3

lib/TreeOperations/tree.d.ts

@@ -1,2 +0,2 @@

import { ParserField, ParserTree } from "../Models";
import { ParserField, ParserTree, Value } from "../Models";
export declare const mutate: (tree: ParserTree, allNodes: ParserField[]) => {

@@ -11,1 +11,2 @@ updateFieldOnNode: (node: ParserField, i: number, updatedField: ParserField) => void;

};
export declare const checkValueType: (node: ParserField, nodes: ParserField[]) => Value.Variable | Value.IntValue | Value.FloatValue | Value.StringValue | Value.BooleanValue | Value.EnumValue | Value.ListValue | Value.ObjectValue | Value.IDValue | Value.ScalarValue;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mutate = void 0;
exports.checkValueType = exports.mutate = void 0;
const Models_1 = require("../Models");
const shared_1 = require("../shared");
const directive_1 = require("./directive");
const interface_1 = require("./interface");

@@ -42,2 +43,6 @@ const shared_2 = require("./shared");

(0, shared_2.regenerateId)(updatedField);
if (node.data.type === Models_1.TypeSystemDefinition.DirectiveDefinition) {
const oldField = JSON.parse(JSON.stringify(node.args[i]));
(0, directive_1.recursivelyUpdateDirectiveArgument)(allNodes, node.name, oldField, updatedField, allNodes);
}
if (node.data.type === Models_1.TypeDefinition.InterfaceTypeDefinition) {

@@ -65,2 +70,5 @@ const oldField = JSON.parse(JSON.stringify(node.args[i]));

}
if (node.data.type === Models_1.TypeSystemDefinition.DirectiveDefinition) {
(0, directive_1.recursivelyRenameDirectiveNodes)(allNodes, node.name, newName);
}
if (node.data.type === Models_1.TypeDefinition.InterfaceTypeDefinition) {

@@ -107,2 +115,5 @@ const oldName = node.name;

if (parent) {
if (parent.data.type === Models_1.TypeSystemDefinition.DirectiveDefinition) {
(0, directive_1.recursivelyDeleteDirectiveArgument)(allNodes, parent.name, node);
}
const index = parent.args.indexOf(node);

@@ -130,7 +141,10 @@ deleteFieldFromNode(parent, index);

if (node.data.type === Models_1.Instances.Directive) {
throw new Error('Directives should be removed on node directly not using this function');
throw new Error('Directive Instances should be removed on node directly not using this function');
}
if (node.data.type === Models_1.Instances.Argument) {
throw new Error('Directive Arguments should be removed on node directly not using this function');
throw new Error('Directive Instance Arguments should be removed on node directly not using this function');
}
if (node.data.type === Models_1.TypeSystemDefinition.DirectiveDefinition) {
(0, directive_1.recursivelyDeleteDirectiveNodes)(allNodes, node.name);
}
const deletedNode = tree.nodes.findIndex((n) => n === node);

@@ -195,3 +209,3 @@ if (deletedNode === -1)

value,
type: checkValueType(node, allNodes),
type: (0, exports.checkValueType)(node, allNodes),
};

@@ -245,1 +259,2 @@ };

};
exports.checkValueType = checkValueType;
{
"name": "graphql-js-tree",
"version": "0.2.7",
"version": "0.2.8",
"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