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

graphql-config

Package Overview
Dependencies
Maintainers
4
Versions
320
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-config - npm Package Compare versions

Comparing version 4.5.0-alpha-20230303172027-c80ecbf to 4.5.0-alpha-20230304025109-5dcd2ee

27

cjs/helpers/cosmiconfig.js

@@ -34,19 +34,5 @@ "use strict";

const loadTypeScript = (...args) => {
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { TypeScriptLoader } = require('cosmiconfig-typescript-loader');
return TypeScriptLoader({ transpileOnly: true })(...args);
}
catch (err) {
if (isRequireESMError(err)) {
return jitiLoader(...args);
}
}
};
const jitiLoader = (filepath) => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const jiti = require('jiti')(__filename, {
interopDefault: true,
});
return jiti(filepath);
const { TypeScriptLoader } = require('cosmiconfig-typescript-loader');
return TypeScriptLoader({ transpileOnly: true })(...args);
};

@@ -62,4 +48,2 @@ const loadToml = (...args) => {

'#.config.ts',
'#.config.cts',
'#.config.mts',
'#.config.js',

@@ -73,4 +57,2 @@ '#.config.cjs',

'.#rc.ts',
'.#rc.cts',
'.#rc.mts',
'.#rc.js',

@@ -93,4 +75,2 @@ '.#rc.cjs',

'.ts': loadTypeScript,
'.mts': createCustomLoader(jitiLoader),
'.cts': createCustomLoader(jitiLoader),
'.js': cosmiconfig_1.defaultLoaders['.js'],

@@ -105,4 +85,1 @@ '.json': createCustomLoader(cosmiconfig_1.defaultLoaders['.json']),

}
function isRequireESMError(err) {
return typeof err.stack === 'string' && err.stack.startsWith('Error [ERR_REQUIRE_ESM]:');
}

@@ -30,19 +30,5 @@ import { createRequire } from 'module';

const loadTypeScript = (...args) => {
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { TypeScriptLoader } = require('cosmiconfig-typescript-loader');
return TypeScriptLoader({ transpileOnly: true })(...args);
}
catch (err) {
if (isRequireESMError(err)) {
return jitiLoader(...args);
}
}
};
const jitiLoader = (filepath) => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const jiti = require('jiti')(__filename, {
interopDefault: true,
});
return jiti(filepath);
const { TypeScriptLoader } = require('cosmiconfig-typescript-loader');
return TypeScriptLoader({ transpileOnly: true })(...args);
};

@@ -58,4 +44,2 @@ const loadToml = (...args) => {

'#.config.ts',
'#.config.cts',
'#.config.mts',
'#.config.js',

@@ -69,4 +53,2 @@ '#.config.cjs',

'.#rc.ts',
'.#rc.cts',
'.#rc.mts',
'.#rc.js',

@@ -89,4 +71,2 @@ '.#rc.cjs',

'.ts': loadTypeScript,
'.mts': createCustomLoader(jitiLoader),
'.cts': createCustomLoader(jitiLoader),
'.js': defaultLoaders['.js'],

@@ -101,4 +81,1 @@ '.json': createCustomLoader(defaultLoaders['.json']),

}
function isRequireESMError(err) {
return typeof err.stack === 'string' && err.stack.startsWith('Error [ERR_REQUIRE_ESM]:');
}

3

package.json
{
"name": "graphql-config",
"version": "4.5.0-alpha-20230303172027-c80ecbf",
"version": "4.5.0-alpha-20230304025109-5dcd2ee",
"description": "The easiest way to configure your development environment with your GraphQL schema (supported by most tools, editors & IDEs)",

@@ -27,3 +27,2 @@ "sideEffects": false,

"cosmiconfig": "8.0.0",
"jiti": "1.17.1",
"minimatch": "4.2.1",

@@ -30,0 +29,0 @@ "string-env-interpolation": "1.0.1",

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