Socket
Socket
Sign inDemoInstall

@graphql-tools/json-file-loader

Package Overview
Dependencies
Maintainers
3
Versions
1022
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/json-file-loader - npm Package Compare versions

Comparing version 8.0.0 to 8.0.1-alpha-20240222154539-b27ae8605c354eed2b24844a475c8889ccc90dfb

20

cjs/index.js

@@ -5,8 +5,8 @@ "use strict";

const tslib_1 = require("tslib");
const utils_1 = require("@graphql-tools/utils");
const fs_1 = require("fs");
const path_1 = require("path");
const fs_1 = require("fs");
const process_1 = require("process");
const globby_1 = tslib_1.__importDefault(require("globby"));
const unixify_1 = tslib_1.__importDefault(require("unixify"));
const utils_1 = require("@graphql-tools/utils");
const { readFile, access } = fs_1.promises;

@@ -45,3 +45,5 @@ const FILE_EXTENSIONS = ['.json'];

if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) {
const normalizedFilePath = (0, path_1.isAbsolute)(pointer) ? pointer : (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), pointer);
const normalizedFilePath = (0, path_1.isAbsolute)(pointer)
? pointer
: (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), pointer);
try {

@@ -61,3 +63,5 @@ await access(normalizedFilePath);

if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) {
const normalizedFilePath = (0, path_1.isAbsolute)(pointer) ? pointer : (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), pointer);
const normalizedFilePath = (0, path_1.isAbsolute)(pointer)
? pointer
: (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), pointer);
return (0, fs_1.existsSync)(normalizedFilePath);

@@ -90,3 +94,5 @@ }

try {
const normalizedFilePath = (0, path_1.isAbsolute)(path) ? path : (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), path);
const normalizedFilePath = (0, path_1.isAbsolute)(path)
? path
: (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), path);
const rawSDL = await readFile(normalizedFilePath, { encoding: 'utf8' });

@@ -118,3 +124,5 @@ finalResult.push(this.handleFileContent(normalizedFilePath, rawSDL, options));

try {
const normalizedFilePath = (0, path_1.isAbsolute)(path) ? path : (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), path);
const normalizedFilePath = (0, path_1.isAbsolute)(path)
? path
: (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), path);
const rawSDL = (0, fs_1.readFileSync)(normalizedFilePath, { encoding: 'utf8' });

@@ -121,0 +129,0 @@ finalResult.push(this.handleFileContent(normalizedFilePath, rawSDL, options));

@@ -1,7 +0,7 @@

import { isValidPath, asArray, parseGraphQLJSON } from '@graphql-tools/utils';
import { existsSync, promises as fsPromises, readFileSync } from 'fs';
import { isAbsolute, resolve } from 'path';
import { readFileSync, promises as fsPromises, existsSync } from 'fs';
import { cwd as processCwd, env } from 'process';
import { env, cwd as processCwd } from 'process';
import globby from 'globby';
import unixify from 'unixify';
import { asArray, isValidPath, parseGraphQLJSON, } from '@graphql-tools/utils';
const { readFile, access } = fsPromises;

@@ -40,3 +40,5 @@ const FILE_EXTENSIONS = ['.json'];

if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) {
const normalizedFilePath = isAbsolute(pointer) ? pointer : resolve(options.cwd || processCwd(), pointer);
const normalizedFilePath = isAbsolute(pointer)
? pointer
: resolve(options.cwd || processCwd(), pointer);
try {

@@ -56,3 +58,5 @@ await access(normalizedFilePath);

if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) {
const normalizedFilePath = isAbsolute(pointer) ? pointer : resolve(options.cwd || processCwd(), pointer);
const normalizedFilePath = isAbsolute(pointer)
? pointer
: resolve(options.cwd || processCwd(), pointer);
return existsSync(normalizedFilePath);

@@ -85,3 +89,5 @@ }

try {
const normalizedFilePath = isAbsolute(path) ? path : resolve(options.cwd || processCwd(), path);
const normalizedFilePath = isAbsolute(path)
? path
: resolve(options.cwd || processCwd(), path);
const rawSDL = await readFile(normalizedFilePath, { encoding: 'utf8' });

@@ -113,3 +119,5 @@ finalResult.push(this.handleFileContent(normalizedFilePath, rawSDL, options));

try {
const normalizedFilePath = isAbsolute(path) ? path : resolve(options.cwd || processCwd(), path);
const normalizedFilePath = isAbsolute(path)
? path
: resolve(options.cwd || processCwd(), path);
const rawSDL = readFileSync(normalizedFilePath, { encoding: 'utf8' });

@@ -116,0 +124,0 @@ finalResult.push(this.handleFileContent(normalizedFilePath, rawSDL, options));

{
"name": "@graphql-tools/json-file-loader",
"version": "8.0.0",
"version": "8.0.1-alpha-20240222154539-b27ae8605c354eed2b24844a475c8889ccc90dfb",
"description": "A set of utils for faster development of GraphQL tools",

@@ -10,6 +10,6 @@ "sideEffects": false,

"dependencies": {
"@graphql-tools/utils": "^10.0.0",
"@graphql-tools/utils": "^10.0.13",
"globby": "^11.0.3",
"unixify": "^1.0.0",
"tslib": "^2.4.0"
"tslib": "^2.4.0",
"unixify": "^1.0.0"
},

@@ -16,0 +16,0 @@ "repository": {

@@ -1,2 +0,2 @@

import { Source, Loader, BaseLoaderOptions } from '@graphql-tools/utils';
import { BaseLoaderOptions, Loader, Source } from '@graphql-tools/utils';
/**

@@ -3,0 +3,0 @@ * Additional options for loading from a JSON file

Sorry, the diff of this file is not supported yet

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