Socket
Socket
Sign inDemoInstall

graphql-config

Package Overview
Dependencies
Maintainers
3
Versions
319
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 1.0.0 to 1.0.1

4

lib/GraphQLProjectConfig.js

@@ -69,4 +69,4 @@ "use strict";

filePath = path_1.relative(this.configDir, path_1.resolve(path_1.join(this.configDir, filePath)));
return ((!this.config.includes || utils_1.matchesGlobs(filePath, this.includes)) &&
!utils_1.matchesGlobs(filePath, this.excludes));
return ((!this.config.includes ||
utils_1.matchesGlobs(filePath, this.configDir, this.includes)) && !utils_1.matchesGlobs(filePath, this.configDir, this.excludes));
};

@@ -73,0 +73,0 @@ GraphQLProjectConfig.prototype.getSchema = function () {

@@ -6,3 +6,3 @@ import { GraphQLSchema } from 'graphql';

export declare function normalizeGlob(glob: string): string;
export declare function matchesGlobs(filePath: string, globs?: string[]): boolean;
export declare function matchesGlobs(filePath: string, configDir: string, globs?: string[]): boolean;
export declare function validateConfig(config: GraphQLConfigData): void;

@@ -9,0 +9,0 @@ export declare function mergeConfigs(dest: GraphQLConfigData, src: GraphQLConfigData): GraphQLConfigData;

@@ -87,4 +87,16 @@ "use strict";

exports.normalizeGlob = normalizeGlob;
function matchesGlobs(filePath, globs) {
return (globs || []).some(function (glob) { return minimatch(filePath, glob, { matchBase: true }); });
function matchesGlobs(filePath, configDir, globs) {
return (globs || []).some(function (glob) {
try {
var globStat = fs_1.lstatSync(path_1.join(configDir, glob));
var globToMatch = globStat.isDirectory() ? glob + "/**" : glob;
return minimatch(filePath, globToMatch, { matchBase: true });
}
catch (error) {
// Out of errors that lstat provides, EACCES and ENOENT are the
// most likely. For both cases there is no need to continue
// furthermore with the glob match.
return false;
}
});
}

@@ -91,0 +103,0 @@ exports.matchesGlobs = matchesGlobs;

{
"name": "graphql-config",
"version": "1.0.0",
"version": "1.0.1",
"description": "The easiest way to configure your development environment with your GraphQL schema (supported by most tools, editors & IDEs)",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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