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

@graphql-tools/utils

Package Overview
Dependencies
Maintainers
4
Versions
1305
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/utils - npm Package Compare versions

Comparing version 10.6.0 to 10.6.1-alpha-20241127191302-c4315873cd36b96c5f77bba782be9e542ef931a3

19

cjs/helpers.js

@@ -5,2 +5,11 @@ "use strict";

const graphql_1 = require("graphql");
function isURL(str) {
try {
const url = new URL(str);
return !!url;
}
catch (e) {
return false;
}
}
const asArray = (fns) => (Array.isArray(fns) ? fns : fns ? [fns] : []);

@@ -18,3 +27,3 @@ exports.asArray = asArray;

// if the string is a SDL
if (invalidDocRegex.test(str)) {
if (invalidDocRegex.test(str) || isURL(str)) {
return false;

@@ -26,3 +35,9 @@ }

}
catch (e) { }
catch (e) {
if (!e.message.includes('EOF') &&
str.replace(/(\#[^*]*)/g, '').trim() !== '' &&
str.includes(' ')) {
throw new Error(`Failed to parse the GraphQL document. ${e.message}\n${str}`);
}
}
return false;

@@ -29,0 +44,0 @@ }

import { parse } from 'graphql';
function isURL(str) {
try {
const url = new URL(str);
return !!url;
}
catch (e) {
return false;
}
}
export const asArray = (fns) => (Array.isArray(fns) ? fns : fns ? [fns] : []);

@@ -13,3 +22,3 @@ const invalidDocRegex = /\.[a-z0-9]+$/i;

// if the string is a SDL
if (invalidDocRegex.test(str)) {
if (invalidDocRegex.test(str) || isURL(str)) {
return false;

@@ -21,3 +30,9 @@ }

}
catch (e) { }
catch (e) {
if (!e.message.includes('EOF') &&
str.replace(/(\#[^*]*)/g, '').trim() !== '' &&
str.includes(' ')) {
throw new Error(`Failed to parse the GraphQL document. ${e.message}\n${str}`);
}
}
return false;

@@ -24,0 +39,0 @@ }

2

package.json
{
"name": "@graphql-tools/utils",
"version": "10.6.0",
"version": "10.6.1-alpha-20241127191302-c4315873cd36b96c5f77bba782be9e542ef931a3",
"description": "Common package containing utils and types for GraphQL tools",

@@ -5,0 +5,0 @@ "sideEffects": false,

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