graphql-config
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -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", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71526
1389
2