@graphql-markdown/utils
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"@graphql-tools/load": "^7.8.14" | ||
"@graphql-tools/load": "^8.0.0" | ||
}, | ||
@@ -29,0 +29,0 @@ "peerDependencies": { |
const { hasProperty, isEmpty } = require("./object"); | ||
const WILDCARD_DIRECTIVE = "*"; | ||
function getCustomDirectives( | ||
@@ -18,4 +20,3 @@ { directives: schemaDirectives } = { directives: undefined }, | ||
if ( | ||
hasProperty(schemaDirectives, schemaDirectiveName) && | ||
hasProperty(customDirectiveOptions, schemaDirectiveName) === false | ||
isCustomDirective(schemaDirectiveName, customDirectiveOptions) === false | ||
) { | ||
@@ -27,3 +28,3 @@ continue; | ||
type: schemaDirectives[schemaDirectiveName], | ||
descriptor: customDirectiveOptions[schemaDirectiveName].descriptor, | ||
descriptor: getDescriptor(schemaDirectiveName, customDirectiveOptions), | ||
}; | ||
@@ -35,2 +36,21 @@ } | ||
module.exports = { getCustomDirectives }; | ||
function getDescriptor(schemaDirectiveName, customDirectiveOptions) { | ||
if (hasProperty(customDirectiveOptions, schemaDirectiveName) === true) { | ||
return customDirectiveOptions[schemaDirectiveName].descriptor; | ||
} | ||
if (hasProperty(customDirectiveOptions, WILDCARD_DIRECTIVE) === true) { | ||
return customDirectiveOptions[WILDCARD_DIRECTIVE].descriptor; | ||
} | ||
return undefined; | ||
} | ||
function isCustomDirective(schemaDirectiveName, customDirectiveOptions) { | ||
return ( | ||
hasProperty(customDirectiveOptions, schemaDirectiveName) === true || | ||
hasProperty(customDirectiveOptions, WILDCARD_DIRECTIVE) === true | ||
); | ||
} | ||
module.exports = { getCustomDirectives, getDescriptor, isCustomDirective }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21930
672
+ Added@graphql-tools/load@8.0.11(transitive)
+ Added@graphql-tools/merge@9.0.16(transitive)
+ Added@graphql-tools/schema@10.0.15(transitive)
+ Added@graphql-tools/utils@10.7.1(transitive)
+ Addedcross-inspect@1.0.1(transitive)
+ Addeddset@3.1.4(transitive)
- Removed@graphql-tools/load@7.8.14(transitive)
- Removed@graphql-tools/merge@8.4.2(transitive)
- Removed@graphql-tools/schema@9.0.19(transitive)
- Removed@graphql-tools/utils@9.2.1(transitive)
Updated@graphql-tools/load@^8.0.0