From 46f88fd0646fb4d313a60288fd18f9e16fbde4ec Mon Sep 17 00:00:00 2001 From: Nik Date: Mon, 22 Apr 2024 15:12:02 +0200 Subject: [PATCH] fix: removed not used utilities and fixed comment (#1093) * Removed not used functions * Fixed typo --- lib/queryDepth.js | 2 +- lib/util.js | 29 ----------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 lib/util.js diff --git a/lib/queryDepth.js b/lib/queryDepth.js index 0e2b8086..7aa2a717 100644 --- a/lib/queryDepth.js +++ b/lib/queryDepth.js @@ -5,7 +5,7 @@ const { MER_ERR_GQL_QUERY_DEPTH } = require('./errors') /** * Returns the depth of nodes in a graphql query - * Based on the the GraphQL Depth Limit package from Stem (https://stem.is) + * Based on the GraphQL Depth Limit package from Stem (https://stem.is) * Project: graphql-depth-limit https://github.com/stems/graphql-depth-limit * Copyright (c) 2017 Stem * License (MIT License) https://github.com/stems/graphql-depth-limit/blob/master/LICENSE diff --git a/lib/util.js b/lib/util.js deleted file mode 100644 index 8a836203..00000000 --- a/lib/util.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict' - -function hasDirective (directiveName, node) { - if (!node.directives || node.directives.length < 1) { - return false - } - for (let i = 0; i < node.directives.length; i++) { - if (node.directives[i].name.value === directiveName) { - return true - } - } -} - -function hasExtensionDirective (node) { - if (!node.directives || node.directives.length < 1) { - return false - } - for (let i = 0; i < node.directives.length; i++) { - const directive = node.directives[i].name.value - if (directive === 'extends' || directive === 'requires') { - return true - } - } -} - -module.exports = { - hasDirective, - hasExtensionDirective -}