summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/flat-cache/cache.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-08-06 12:11:02 -0700
committercjihrig <cjihrig@gmail.com>2016-08-10 13:04:27 -0400
commit60ff991c09d61d760e38af5899b5fec3e6a38ee9 (patch)
treecd9762d9851984326b61ac3ec27083ea60897286 /tools/eslint/node_modules/flat-cache/cache.js
parent4a8b8048f274eba6ee6283f89d0effac16f59c56 (diff)
downloadnode-new-60ff991c09d61d760e38af5899b5fec3e6a38ee9.tar.gz
tools: update to ESLint 3.2.2
PR-URL: https://github.com/nodejs/node/pull/7999 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Diffstat (limited to 'tools/eslint/node_modules/flat-cache/cache.js')
-rw-r--r--tools/eslint/node_modules/flat-cache/cache.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/eslint/node_modules/flat-cache/cache.js b/tools/eslint/node_modules/flat-cache/cache.js
index 90b8e77c30..e7d205e5e1 100644
--- a/tools/eslint/node_modules/flat-cache/cache.js
+++ b/tools/eslint/node_modules/flat-cache/cache.js
@@ -1,8 +1,8 @@
var path = require( 'path' );
var fs = require( 'graceful-fs' );
-var readJSON = require( 'read-json-sync' );
-var write = require( 'write' );
var del = require( 'del' ).sync;
+var readJSON = require( './utils' ).readJSON;
+var writeJSON = require( './utils' ).writeJSON;
var cache = {
/**
@@ -100,13 +100,14 @@ var cache = {
/**
* Save the state of the cache identified by the docId to disk
* as a JSON structure
+ * @param [noPrune=false] {Boolean} whether to remove from cache the non visited files
* @method save
*/
- save: function () {
+ save: function ( noPrune ) {
var me = this;
- me._prune();
- write.sync( me._pathToFile, JSON.stringify( me._persisted ) );
+ (!noPrune) && me._prune();
+ writeJSON( me._pathToFile, me._persisted );
},
/**