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

@graphql-inspector/config

Package Overview
Dependencies
Maintainers
1
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-inspector/config - npm Package Compare versions

Comparing version 1.30.0-rc.0 to 1.30.1

41

index.cjs.js

@@ -5,26 +5,29 @@ 'use strict';

const tslib = require('tslib');
const cosmiconfig = require('cosmiconfig');
const path = require('path');
async function useConfig(options) {
function useConfig(options) {
var _a, _b, _c, _d;
const cosmi = cosmiconfig.cosmiconfig('inspector', {
cache: true,
return tslib.__awaiter(this, void 0, void 0, function* () {
const cosmi = cosmiconfig.cosmiconfig('inspector', {
cache: true,
});
const config = yield ((options === null || options === void 0 ? void 0 : options.config) ? cosmi.load(path.isAbsolute(options.config)
? options.config
: path.resolve(process.cwd(), options.config))
: cosmi.search());
if (!config) {
throw new Error('Config not found');
}
if (config.isEmpty) {
throw new Error('Config is empty');
}
return {
use: {
loaders: ensureList((_b = (_a = config.config) === null || _a === void 0 ? void 0 : _a.use) === null || _b === void 0 ? void 0 : _b.loaders, 'loaders'),
commands: ensureList((_d = (_c = config.config) === null || _c === void 0 ? void 0 : _c.use) === null || _d === void 0 ? void 0 : _d.commands, 'commands'),
},
};
});
const config = await ((options === null || options === void 0 ? void 0 : options.config) ? cosmi.load(path.isAbsolute(options.config)
? options.config
: path.resolve(process.cwd(), options.config))
: cosmi.search());
if (!config) {
throw new Error('Config not found');
}
if (config.isEmpty) {
throw new Error('Config is empty');
}
return {
use: {
loaders: ensureList((_b = (_a = config.config) === null || _a === void 0 ? void 0 : _a.use) === null || _b === void 0 ? void 0 : _b.loaders, 'loaders'),
commands: ensureList((_d = (_c = config.config) === null || _c === void 0 ? void 0 : _c.use) === null || _d === void 0 ? void 0 : _d.commands, 'commands'),
},
};
}

@@ -31,0 +34,0 @@ function ensureList(list, path) {

@@ -0,25 +1,28 @@

import { __awaiter } from 'tslib';
import { cosmiconfig } from 'cosmiconfig';
import { isAbsolute, resolve } from 'path';
async function useConfig(options) {
function useConfig(options) {
var _a, _b, _c, _d;
const cosmi = cosmiconfig('inspector', {
cache: true,
return __awaiter(this, void 0, void 0, function* () {
const cosmi = cosmiconfig('inspector', {
cache: true,
});
const config = yield ((options === null || options === void 0 ? void 0 : options.config) ? cosmi.load(isAbsolute(options.config)
? options.config
: resolve(process.cwd(), options.config))
: cosmi.search());
if (!config) {
throw new Error('Config not found');
}
if (config.isEmpty) {
throw new Error('Config is empty');
}
return {
use: {
loaders: ensureList((_b = (_a = config.config) === null || _a === void 0 ? void 0 : _a.use) === null || _b === void 0 ? void 0 : _b.loaders, 'loaders'),
commands: ensureList((_d = (_c = config.config) === null || _c === void 0 ? void 0 : _c.use) === null || _d === void 0 ? void 0 : _d.commands, 'commands'),
},
};
});
const config = await ((options === null || options === void 0 ? void 0 : options.config) ? cosmi.load(isAbsolute(options.config)
? options.config
: resolve(process.cwd(), options.config))
: cosmi.search());
if (!config) {
throw new Error('Config not found');
}
if (config.isEmpty) {
throw new Error('Config is empty');
}
return {
use: {
loaders: ensureList((_b = (_a = config.config) === null || _a === void 0 ? void 0 : _a.use) === null || _b === void 0 ? void 0 : _b.loaders, 'loaders'),
commands: ensureList((_d = (_c = config.config) === null || _c === void 0 ? void 0 : _c.use) === null || _d === void 0 ? void 0 : _d.commands, 'commands'),
},
};
}

@@ -26,0 +29,0 @@ function ensureList(list, path) {

{
"name": "@graphql-inspector/config",
"version": "1.30.0-rc.0",
"version": "1.30.1",
"peerDependencies": {

@@ -8,6 +8,2 @@ "graphql": "^0.13.0 || ^14.0.0 || ^15.0.0",

},
"dependencies": {
"cosmiconfig": "6.0.0",
"tslib": "^1.11.1"
},
"repository": {

@@ -14,0 +10,0 @@ "type": "git",

Sorry, the diff of this file is not supported yet

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