@graphql-tools/utils
Advanced tools
Comparing version 10.7.2 to 10.8.0-alpha-20250124175511-cf926757b2731edb762be661f8671ed41d778b2f
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.asArray = void 0; | ||
exports.isUrl = isUrl; | ||
exports.isDocumentString = isDocumentString; | ||
@@ -12,3 +13,6 @@ exports.isValidPath = isValidPath; | ||
const graphql_1 = require("graphql"); | ||
function isURL(str) { | ||
function isUrl(str) { | ||
if (URL.canParse) { | ||
return URL.canParse(str); | ||
} | ||
try { | ||
@@ -34,3 +38,3 @@ const url = new URL(str); | ||
// if the string is a SDL | ||
if (invalidDocRegex.test(str) || isURL(str)) { | ||
if (invalidDocRegex.test(str) || isUrl(str)) { | ||
return false; | ||
@@ -37,0 +41,0 @@ } |
import { parse } from 'graphql'; | ||
function isURL(str) { | ||
export function isUrl(str) { | ||
if (URL.canParse) { | ||
return URL.canParse(str); | ||
} | ||
try { | ||
@@ -22,3 +25,3 @@ const url = new URL(str); | ||
// if the string is a SDL | ||
if (invalidDocRegex.test(str) || isURL(str)) { | ||
if (invalidDocRegex.test(str) || isUrl(str)) { | ||
return false; | ||
@@ -25,0 +28,0 @@ } |
{ | ||
"name": "@graphql-tools/utils", | ||
"version": "10.7.2", | ||
"version": "10.8.0-alpha-20250124175511-cf926757b2731edb762be661f8671ed41d778b2f", | ||
"description": "Common package containing utils and types for GraphQL tools", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
import { ASTNode } from 'graphql'; | ||
export declare function isUrl(str: string): boolean; | ||
export declare const asArray: <T>(fns: T | T[]) => T[]; | ||
@@ -3,0 +4,0 @@ export declare function isDocumentString(str: any): boolean; |
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
516773
11263
2