summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/flat-cache
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
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')
-rw-r--r--tools/eslint/node_modules/flat-cache/README.md3
-rw-r--r--tools/eslint/node_modules/flat-cache/cache.js11
-rw-r--r--tools/eslint/node_modules/flat-cache/changelog.md41
-rw-r--r--tools/eslint/node_modules/flat-cache/package.json66
-rw-r--r--tools/eslint/node_modules/flat-cache/utils.js29
5 files changed, 119 insertions, 31 deletions
diff --git a/tools/eslint/node_modules/flat-cache/README.md b/tools/eslint/node_modules/flat-cache/README.md
index 33a315fb34..77770aa3ba 100644
--- a/tools/eslint/node_modules/flat-cache/README.md
+++ b/tools/eslint/node_modules/flat-cache/README.md
@@ -29,6 +29,7 @@ cache.removeKey('key'); // removes a key from the cache
// save it to disk
cache.save(); // very important, if you don't save no changes will be persisted.
+// cache.save( true /* noPrune */) // can be used to prevent the removal of non visited keys
// loads the cache from a given directory, if one does
// not exists for the given Id a new one will be prepared to be created
@@ -57,6 +58,8 @@ storage was needed and Bam! this module was born.
- All the changes to the cache state are done to memory
- I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module
intentionally dumb and simple
+- Non visited keys are removed when `cache.save()` is called. If this is not desired, you can pass `true` to the save call
+ like: `cache.save( true /* noPrune */ )`.
## License
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 );
},
/**
diff --git a/tools/eslint/node_modules/flat-cache/changelog.md b/tools/eslint/node_modules/flat-cache/changelog.md
index 6ba9ef745c..4312b4c32a 100644
--- a/tools/eslint/node_modules/flat-cache/changelog.md
+++ b/tools/eslint/node_modules/flat-cache/changelog.md
@@ -1,5 +1,46 @@
# flat-cache - Changelog
+## v1.2.1
+- **Bug Fixes**
+ - Add missing utils.js file to the package. closes [#8](https://github.com/royriojas/flat-cache/issues/8) - [ec10cf2]( https://github.com/royriojas/flat-cache/commit/ec10cf2 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:18:57
+
+
+## v1.2.0
+- **Documentation**
+ - Add documentation about noPrune option - [23e11f9]( https://github.com/royriojas/flat-cache/commit/23e11f9 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:06:49
+
+
+## v1.0.11
+- **Features**
+ - Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a]( https://github.com/royriojas/flat-cache/commit/2c8016a ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 04:00:29
+
+
+ - Add json read and write utility based on circular-json - [c31081e]( https://github.com/royriojas/flat-cache/commit/c31081e ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:58:17
+
+
+- **Bug Fixes**
+ - Remove UTF16 BOM stripping - [4a41e22]( https://github.com/royriojas/flat-cache/commit/4a41e22 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 04:18:06
+
+ Since we control both writing and reading of JSON stream, there no needs
+ to handle unicode BOM.
+ - Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed]( https://github.com/royriojas/flat-cache/commit/cd7aeed ), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 13:11:59
+
+
+- **Tests Related fixes**
+ - Add missing file from eslint test - [d6fa3c3]( https://github.com/royriojas/flat-cache/commit/d6fa3c3 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 04:15:51
+
+
+ - Add test for circular json serialization / deserialization - [07d2ddd]( https://github.com/royriojas/flat-cache/commit/07d2ddd ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:59:36
+
+
+- **Refactoring**
+ - Remove unused read-json-sync - [2be1c24]( https://github.com/royriojas/flat-cache/commit/2be1c24 ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 10:59:18
+
+
+- **Build Scripts Changes**
+ - travis tests on 0.12 and 4x - [3a613fd]( https://github.com/royriojas/flat-cache/commit/3a613fd ), [royriojas](https://github.com/royriojas), 15/11/2015 17:34:40
+
+
## v1.0.10
- **Build Scripts Changes**
- add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 18:04:08
diff --git a/tools/eslint/node_modules/flat-cache/package.json b/tools/eslint/node_modules/flat-cache/package.json
index 3c923ffe84..3c46762ece 100644
--- a/tools/eslint/node_modules/flat-cache/package.json
+++ b/tools/eslint/node_modules/flat-cache/package.json
@@ -1,37 +1,50 @@
{
"_args": [
[
- "flat-cache@^1.0.9",
+ {
+ "raw": "flat-cache@^1.2.1",
+ "scope": null,
+ "escapedName": "flat-cache",
+ "name": "flat-cache",
+ "rawSpec": "^1.2.1",
+ "spec": ">=1.2.1 <2.0.0",
+ "type": "range"
+ },
"/Users/trott/io.js/tools/node_modules/file-entry-cache"
]
],
- "_from": "flat-cache@>=1.0.9 <2.0.0",
- "_id": "flat-cache@1.0.10",
+ "_from": "flat-cache@>=1.2.1 <2.0.0",
+ "_id": "flat-cache@1.2.1",
"_inCache": true,
"_installable": true,
"_location": "/flat-cache",
- "_nodeVersion": "0.12.0",
+ "_nodeVersion": "6.3.0",
+ "_npmOperationalInternal": {
+ "host": "packages-16-east.internal.npmjs.com",
+ "tmp": "tmp/flat-cache-1.2.1.tgz_1470043202592_0.29112970223650336"
+ },
"_npmUser": {
- "email": "royriojas@gmail.com",
- "name": "royriojas"
+ "name": "royriojas",
+ "email": "royriojas@gmail.com"
},
- "_npmVersion": "2.14.5",
+ "_npmVersion": "3.10.3",
"_phantomChildren": {},
"_requested": {
- "name": "flat-cache",
- "raw": "flat-cache@^1.0.9",
- "rawSpec": "^1.0.9",
+ "raw": "flat-cache@^1.2.1",
"scope": null,
- "spec": ">=1.0.9 <2.0.0",
+ "escapedName": "flat-cache",
+ "name": "flat-cache",
+ "rawSpec": "^1.2.1",
+ "spec": ">=1.2.1 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/file-entry-cache"
],
- "_resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.0.10.tgz",
- "_shasum": "73d6df4a28502160a05e059544a6aeeae8b0047a",
+ "_resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.1.tgz",
+ "_shasum": "6c837d6225a7de5659323740b36d5361f71691ff",
"_shrinkwrap": null,
- "_spec": "flat-cache@^1.0.9",
+ "_spec": "flat-cache@^1.2.1",
"_where": "/Users/trott/io.js/tools/node_modules/file-entry-cache",
"author": {
"name": "Roy Riojas",
@@ -41,21 +54,21 @@
"url": "https://github.com/royriojas/flat-cache/issues"
},
"changelogx": {
- "authorURL": "https://github.com/{0}",
- "commitURL": "https://github.com/royriojas/flat-cache/commit/{0}",
"ignoreRegExp": [
"BLD: Release",
"DOC: Generate Changelog",
"Generated Changelog"
],
"issueIDRegExp": "#(\\d+)",
+ "commitURL": "https://github.com/royriojas/flat-cache/commit/{0}",
+ "authorURL": "https://github.com/{0}",
"issueIDURL": "https://github.com/royriojas/flat-cache/issues/{0}",
"projectName": "flat-cache"
},
"dependencies": {
+ "circular-json": "^0.3.0",
"del": "^2.0.2",
"graceful-fs": "^4.1.2",
- "read-json-sync": "^1.1.0",
"write": "^0.2.1"
},
"description": "A stupidly simple key/value storage using files to persist some data",
@@ -76,16 +89,17 @@
},
"directories": {},
"dist": {
- "shasum": "73d6df4a28502160a05e059544a6aeeae8b0047a",
- "tarball": "http://registry.npmjs.org/flat-cache/-/flat-cache-1.0.10.tgz"
+ "shasum": "6c837d6225a7de5659323740b36d5361f71691ff",
+ "tarball": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.2.1.tgz"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
- "cache.js"
+ "cache.js",
+ "utils.js"
],
- "gitHead": "58bb40ccc87d79eb16146629be79d7577e6632da",
+ "gitHead": "ca27117e382576b93d22754902bf7d80f607fb22",
"homepage": "https://github.com/royriojas/flat-cache#readme",
"keywords": [
"json cache",
@@ -99,8 +113,8 @@
"main": "cache.js",
"maintainers": [
{
- "email": "royriojas@gmail.com",
- "name": "royriojas"
+ "name": "royriojas",
+ "email": "royriojas@gmail.com"
}
],
"name": "flat-cache",
@@ -118,7 +132,7 @@
},
"scripts": {
"autofix": "npm run beautify && npm run eslint-fix",
- "beautify": "esbeautifier 'cache.js' 'specs/**/*.js'",
+ "beautify": "esbeautifier 'cache.js' 'test/specs/**/*.js'",
"beautify-check": "npm run beautify -- -k",
"bump-major": "npm run pre-v && npm version major -m 'BLD: Release v%s' && npm run post-v",
"bump-minor": "npm run pre-v && npm version minor -m 'BLD: Release v%s' && npm run post-v",
@@ -127,7 +141,7 @@
"check": "npm run beautify-check && npm run eslint",
"cover": "istanbul cover test/runner.js html text-summary",
"do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify",
- "eslint": "eslinter 'cache.js' 'specs/**/*.js'",
+ "eslint": "eslinter 'cache.js' 'utils.js' 'specs/**/*.js'",
"eslint-fix": "npm run eslint -- --fix",
"install-hooks": "prepush install && changelogx install-hook && precommit install",
"post-v": "npm run do-changelog && git push --no-verify && git push --tags --no-verify",
@@ -137,5 +151,5 @@
"verify": "npm run check && npm run test:cache",
"watch": "watch-run -i -p 'test/specs/**/*.js' istanbul cover test/runner.js html text-summary"
},
- "version": "1.0.10"
+ "version": "1.2.1"
}
diff --git a/tools/eslint/node_modules/flat-cache/utils.js b/tools/eslint/node_modules/flat-cache/utils.js
new file mode 100644
index 0000000000..3bdd1efa37
--- /dev/null
+++ b/tools/eslint/node_modules/flat-cache/utils.js
@@ -0,0 +1,29 @@
+var fs = require( 'graceful-fs' );
+var write = require( 'write' );
+var circularJson = require( 'circular-json' );
+
+module.exports = {
+
+ /**
+ * Read json file synchronously using circular-json
+ *
+ * @method readJSON
+ * @param {String} filePath Json filepath
+ * @returns {*} parse result
+ */
+ readJSON: function ( filePath ) {
+ return circularJson.parse( fs.readFileSync( filePath ).toString() );
+ },
+
+ /**
+ * Write json file synchronously using circular-json
+ *
+ * @method writeJSON
+ * @param {String} filePath Json filepath
+ * @param {*} data Object to serialize
+ */
+ writeJSON: function (filePath, data ) {
+ write.sync( filePath, circularJson.stringify( data ) );
+ }
+
+};