Expose clearCache function (#2451)

This commit is contained in:
Lucas Azzola authored and GitHub committed 2017-07-11 20:40:51 +10:00
1 parent 25a5e3ffe3
commit 3136907a15
2 files changed
+9 -3

No files matched your search

+3 -2
View File
@@ -9,7 +9,7 @@ const printDocToString = require("./src/doc-printer").printDocToString;
const normalizeOptions = require("./src/options").normalize; const normalizeOptions = require("./src/options").normalize;
const parser = require("./src/parser"); const parser = require("./src/parser");
const printDocToDebug = require("./src/doc-debug").printDocToDebug; const printDocToDebug = require("./src/doc-debug").printDocToDebug;
const resolveConfig = require("./src/resolve-config").resolveConfig; const config = require("./src/resolve-config");
function guessLineEnding(text) { function guessLineEnding(text) {
const index = text.indexOf("\n"); const index = text.indexOf("\n");
@@ -338,7 +338,8 @@ module.exports = {
} }
}, },
resolveConfig, resolveConfig: config.resolveConfig,
clearConfigCache: config.clearCache,
version, version,
+6 -1
View File
@@ -25,6 +25,10 @@ function resolveConfig(filePath, opts) {
); );
} }
function clearCache() {
withCache.clearCaches();
}
function resolveConfigFile(filePath) { function resolveConfigFile(filePath) {
return noCache.load(filePath).then(result => { return noCache.load(filePath).then(result => {
if (result) { if (result) {
@@ -64,5 +68,6 @@ function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
module.exports = { module.exports = {
resolveConfig, resolveConfig,
resolveConfigFile resolveConfigFile,
clearCache
}; };