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

@winninjs/graphql-io-utils

Package Overview
Dependencies
Maintainers
11
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@winninjs/graphql-io-utils - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

6

package.json
{
"name": "@winninjs/graphql-io-utils",
"version": "1.4.1",
"version": "1.5.0",
"description": "Utilities directives and scalar types to help on graphql input/output validation and sanitization.",

@@ -18,2 +18,3 @@ "main": "src/index.js",

"email-validator": "^2.0.4",
"graphql": "^15.5.1",
"redact-pii": "^3.2.3"

@@ -26,5 +27,2 @@ },

},
"peerDependencies": {
"graphql": "^15.5.1"
},
"directories": {

@@ -31,0 +29,0 @@ "test": "test"

const { SchemaDirectiveVisitor } = require("graphql-tools")
const { GraphQLScalarType, GraphQLNonNull } = require("graphql")
const { GraphQLScalarType, GraphQLNonNull, isNonNullType, isScalarType } = require("graphql")

@@ -15,5 +15,5 @@ class StringUtilsDirective extends SchemaDirectiveVisitor {

wrapType(field) {
if ( field.type instanceof GraphQLNonNull && field.type.ofType instanceof GraphQLScalarType) {
if ( isNonNullType(field.type) && isScalarType(field.type.ofType)) {
field.type = new GraphQLNonNull(new StringUtilsScalarType(field.type.ofType, this.args))
} else if (field.type instanceof GraphQLScalarType) {
} else if (isScalarType(field.type)) {
field.type = new StringUtilsScalarType(field.type, this.args)

@@ -20,0 +20,0 @@ } else {

const { SchemaDirectiveVisitor } = require("graphql-tools")
const { GraphQLScalarType, GraphQLNonNull } = require("graphql")
const { GraphQLScalarType, GraphQLNonNull, isNonNullType, isScalarType } = require("graphql")
const emailValidator = require("email-validator")

@@ -103,5 +103,5 @@

wrapType(type,name) {
if ( type instanceof GraphQLNonNull && type.ofType instanceof GraphQLScalarType) {
if ( isNonNullType(type) && isScalarType(type.ofType)) {
return new GraphQLNonNull(new ValidateScalarType(type.ofType,name, this.args))
} else if (type instanceof GraphQLScalarType) {
} else if (isScalarType(type)) {
return new ValidateScalarType(type,name, this.args)

@@ -108,0 +108,0 @@ } else {

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