graphql-language-service-config
Advanced tools
Comparing version 0.0.15 to 0.0.16
@@ -66,3 +66,5 @@ 'use strict'; | ||
if (appConfig) { | ||
return _this.isFileInIncludeDirs(filePath, appName); | ||
// check if the file is included in includeDirs, | ||
// and is not included in excludeDirs | ||
return _this.isFileInIncludeDirs(filePath, appName) && !_this.isFileInExcludeDirs(filePath, appName); | ||
} | ||
@@ -121,2 +123,15 @@ return false; | ||
GraphQLConfig.prototype.isFileInExcludeDirs = function isFileInExcludeDirs(fileName, appName) { | ||
if (appName) { | ||
if (this._config[PROJECTS_NAME] && this._config[PROJECTS_NAME][appName] && this._config[PROJECTS_NAME][appName].excludeDirs) { | ||
return this._config[PROJECTS_NAME][appName].excludeDirs.some(function (dirPath) { | ||
return fileName.indexOf(dirPath) !== -1; | ||
}); | ||
} | ||
} | ||
return this._config.excludeDirs ? this._config.excludeDirs.some(function (dirPath) { | ||
return fileName.indexOf(dirPath) !== -1; | ||
}) : false; | ||
}; | ||
GraphQLConfig.prototype.getCustomValidationRulesModulePath = function getCustomValidationRulesModulePath(appName) { | ||
@@ -123,0 +138,0 @@ var modulePath = void 0; |
{ | ||
"name": "graphql-language-service-config", | ||
"repository": "https://github.com/graphql/graphql-language-service", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "A tool-kit for accessing and using `.graphqlrc` configuration files", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
Sorry, the diff of this file is not supported yet
24112
367