Expose clearCache function (#2451)

master
Lucas Azzola 2017-07-11 20:40:51 +10:00 committed by GitHub
parent 25a5e3ffe3
commit 3136907a15
2 changed files with 9 additions and 3 deletions

View File

@ -9,7 +9,7 @@ const printDocToString = require("./src/doc-printer").printDocToString;
const normalizeOptions = require("./src/options").normalize;
const parser = require("./src/parser");
const printDocToDebug = require("./src/doc-debug").printDocToDebug;
const resolveConfig = require("./src/resolve-config").resolveConfig;
const config = require("./src/resolve-config");
function guessLineEnding(text) {
const index = text.indexOf("\n");
@ -338,7 +338,8 @@ module.exports = {
}
},
resolveConfig,
resolveConfig: config.resolveConfig,
clearConfigCache: config.clearCache,
version,

View File

@ -25,6 +25,10 @@ function resolveConfig(filePath, opts) {
);
}
function clearCache() {
withCache.clearCaches();
}
function resolveConfigFile(filePath) {
return noCache.load(filePath).then(result => {
if (result) {
@ -64,5 +68,6 @@ function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
module.exports = {
resolveConfig,
resolveConfigFile
resolveConfigFile,
clearCache
};