stuff
This commit is contained in:
22
buildfiles/app/node_modules/flat-cache/LICENSE
generated
vendored
Normal file
22
buildfiles/app/node_modules/flat-cache/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 Roy Riojas
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
73
buildfiles/app/node_modules/flat-cache/README.md
generated
vendored
Normal file
73
buildfiles/app/node_modules/flat-cache/README.md
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
# flat-cache
|
||||
> A stupidly simple key/value storage using files to persist the data
|
||||
|
||||
[](https://npmjs.org/package/flat-cache)
|
||||
[](https://travis-ci.org/royriojas/flat-cache)
|
||||
|
||||
## install
|
||||
|
||||
```bash
|
||||
npm i --save flat-cache
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var flatCache = require('flat-cache')
|
||||
// loads the cache, if one does not exists for the given
|
||||
// Id a new one will be prepared to be created
|
||||
var cache = flatCache.load('cacheId');
|
||||
|
||||
// sets a key on the cache
|
||||
cache.setKey('key', { foo: 'var' });
|
||||
|
||||
// get a key from the cache
|
||||
cache.getKey('key') // { foo: 'var' }
|
||||
|
||||
// fetch the entire persisted object
|
||||
cache.all() // { 'key': { foo: 'var' } }
|
||||
|
||||
// remove a key
|
||||
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
|
||||
var cache = flatCache.load('cacheId', path.resolve('./path/to/folder'));
|
||||
|
||||
// The following methods are useful to clear the cache
|
||||
// delete a given cache
|
||||
flatCache.clearCacheById('cacheId') // removes the cacheId document if one exists.
|
||||
|
||||
// delete all cache
|
||||
flatCache.clearAll(); // remove the cache directory
|
||||
```
|
||||
|
||||
## Motivation for this module
|
||||
|
||||
I needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make
|
||||
a script that will beutify files with `esformatter` only execute on the files that were changed since the last run.
|
||||
To make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value`
|
||||
storage was needed and Bam! this module was born.
|
||||
|
||||
## Important notes
|
||||
- If no directory is especified when the `load` method is called, a folder named `.cache` will be created
|
||||
inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you
|
||||
might want to ignore the default `.cache` folder, or specify a custom directory.
|
||||
- The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references
|
||||
- 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
|
||||
|
||||
MIT
|
||||
|
||||
## Changelog
|
||||
|
||||
[changelog](./changelog.md)
|
197
buildfiles/app/node_modules/flat-cache/cache.js
generated
vendored
Normal file
197
buildfiles/app/node_modules/flat-cache/cache.js
generated
vendored
Normal file
@ -0,0 +1,197 @@
|
||||
var path = require( 'path' );
|
||||
var fs = require( 'fs' );
|
||||
var utils = require( './utils' );
|
||||
var del = require( './del' );
|
||||
var writeJSON = utils.writeJSON;
|
||||
|
||||
var cache = {
|
||||
/**
|
||||
* Load a cache identified by the given Id. If the element does not exists, then initialize an empty
|
||||
* cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted
|
||||
* then the cache module directory `./cache` will be used instead
|
||||
*
|
||||
* @method load
|
||||
* @param docId {String} the id of the cache, would also be used as the name of the file cache
|
||||
* @param [cacheDir] {String} directory for the cache entry
|
||||
*/
|
||||
load: function ( docId, cacheDir ) {
|
||||
var me = this;
|
||||
|
||||
me._visited = { };
|
||||
me._persisted = { };
|
||||
me._pathToFile = cacheDir ? path.resolve( cacheDir, docId ) : path.resolve( __dirname, './.cache/', docId );
|
||||
|
||||
if ( fs.existsSync( me._pathToFile ) ) {
|
||||
me._persisted = utils.tryParse( me._pathToFile, { } );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Load the cache from the provided file
|
||||
* @method loadFile
|
||||
* @param {String} pathToFile the path to the file containing the info for the cache
|
||||
*/
|
||||
loadFile: function ( pathToFile ) {
|
||||
var me = this;
|
||||
var dir = path.dirname( pathToFile );
|
||||
var fName = path.basename( pathToFile );
|
||||
|
||||
me.load( fName, dir );
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the entire persisted object
|
||||
* @method all
|
||||
* @returns {*}
|
||||
*/
|
||||
all: function () {
|
||||
return this._persisted;
|
||||
},
|
||||
|
||||
keys: function () {
|
||||
return Object.keys( this._persisted );
|
||||
},
|
||||
/**
|
||||
* sets a key to a given value
|
||||
* @method setKey
|
||||
* @param key {string} the key to set
|
||||
* @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify
|
||||
*/
|
||||
setKey: function ( key, value ) {
|
||||
this._visited[ key ] = true;
|
||||
this._persisted[ key ] = value;
|
||||
},
|
||||
/**
|
||||
* remove a given key from the cache
|
||||
* @method removeKey
|
||||
* @param key {String} the key to remove from the object
|
||||
*/
|
||||
removeKey: function ( key ) {
|
||||
delete this._visited[ key ]; // esfmt-ignore-line
|
||||
delete this._persisted[ key ]; // esfmt-ignore-line
|
||||
},
|
||||
/**
|
||||
* Return the value of the provided key
|
||||
* @method getKey
|
||||
* @param key {String} the name of the key to retrieve
|
||||
* @returns {*} the value from the key
|
||||
*/
|
||||
getKey: function ( key ) {
|
||||
this._visited[ key ] = true;
|
||||
return this._persisted[ key ];
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove keys that were not accessed/set since the
|
||||
* last time the `prune` method was called.
|
||||
* @method _prune
|
||||
* @private
|
||||
*/
|
||||
_prune: function () {
|
||||
var me = this;
|
||||
var obj = { };
|
||||
|
||||
var keys = Object.keys( me._visited );
|
||||
|
||||
// no keys visited for either get or set value
|
||||
if ( keys.length === 0 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
keys.forEach( function ( key ) {
|
||||
obj[ key ] = me._persisted[ key ];
|
||||
} );
|
||||
|
||||
me._visited = { };
|
||||
me._persisted = obj;
|
||||
},
|
||||
|
||||
/**
|
||||
* 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 ( noPrune ) {
|
||||
var me = this;
|
||||
|
||||
(!noPrune) && me._prune();
|
||||
writeJSON( me._pathToFile, me._persisted );
|
||||
},
|
||||
|
||||
/**
|
||||
* remove the file where the cache is persisted
|
||||
* @method removeCacheFile
|
||||
* @return {Boolean} true or false if the file was successfully deleted
|
||||
*/
|
||||
removeCacheFile: function () {
|
||||
return del( this._pathToFile );
|
||||
},
|
||||
/**
|
||||
* Destroy the file cache and cache content.
|
||||
* @method destroy
|
||||
*/
|
||||
destroy: function () {
|
||||
var me = this;
|
||||
me._visited = { };
|
||||
me._persisted = { };
|
||||
|
||||
me.removeCacheFile();
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Alias for create. Should be considered depreacted. Will be removed in next releases
|
||||
*
|
||||
* @method load
|
||||
* @param docId {String} the id of the cache, would also be used as the name of the file cache
|
||||
* @param [cacheDir] {String} directory for the cache entry
|
||||
* @returns {cache} cache instance
|
||||
*/
|
||||
load: function ( docId, cacheDir ) {
|
||||
return this.create( docId, cacheDir );
|
||||
},
|
||||
|
||||
/**
|
||||
* Load a cache identified by the given Id. If the element does not exists, then initialize an empty
|
||||
* cache storage.
|
||||
*
|
||||
* @method create
|
||||
* @param docId {String} the id of the cache, would also be used as the name of the file cache
|
||||
* @param [cacheDir] {String} directory for the cache entry
|
||||
* @returns {cache} cache instance
|
||||
*/
|
||||
create: function ( docId, cacheDir ) {
|
||||
var obj = Object.create( cache );
|
||||
obj.load( docId, cacheDir );
|
||||
return obj;
|
||||
},
|
||||
|
||||
createFromFile: function ( filePath ) {
|
||||
var obj = Object.create( cache );
|
||||
obj.loadFile( filePath );
|
||||
return obj;
|
||||
},
|
||||
/**
|
||||
* Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly
|
||||
*
|
||||
* @method clearCache
|
||||
* @param docId {String} the id of the cache, would also be used as the name of the file cache
|
||||
* @param cacheDir {String} the directory where the cache file was written
|
||||
* @returns {Boolean} true if the cache folder was deleted. False otherwise
|
||||
*/
|
||||
clearCacheById: function ( docId, cacheDir ) {
|
||||
var filePath = cacheDir ? path.resolve( cacheDir, docId ) : path.resolve( __dirname, './.cache/', docId );
|
||||
return del( filePath );
|
||||
},
|
||||
/**
|
||||
* Remove all cache stored in the cache directory
|
||||
* @method clearAll
|
||||
* @returns {Boolean} true if the cache folder was deleted. False otherwise
|
||||
*/
|
||||
clearAll: function ( cacheDir ) {
|
||||
var filePath = cacheDir ? path.resolve( cacheDir ) : path.resolve( __dirname, './.cache/' );
|
||||
return del( filePath );
|
||||
}
|
||||
};
|
300
buildfiles/app/node_modules/flat-cache/changelog.md
generated
vendored
Normal file
300
buildfiles/app/node_modules/flat-cache/changelog.md
generated
vendored
Normal file
@ -0,0 +1,300 @@
|
||||
|
||||
# flat-cache - Changelog
|
||||
## v2.0.1
|
||||
- **Refactoring**
|
||||
- upgrade node modules to latest versions - [6402ed3]( https://github.com/royriojas/flat-cache/commit/6402ed3 ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 21:47:05
|
||||
|
||||
|
||||
## v2.0.0
|
||||
- **Bug Fixes**
|
||||
- upgrade package.json lock file - [8d21c7b]( https://github.com/royriojas/flat-cache/commit/8d21c7b ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 20:03:13
|
||||
|
||||
|
||||
- Use the same versions of node_js that eslint use - [8d23379]( https://github.com/royriojas/flat-cache/commit/8d23379 ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 19:25:11
|
||||
|
||||
|
||||
- **Other changes**
|
||||
- Replace circular-json with flatted ([#36](https://github.com/royriojas/flat-cache/issues/36)) - [b93aced]( https://github.com/royriojas/flat-cache/commit/b93aced ), [C. K. Tang](https://github.com/C. K. Tang), 08/01/2019 20:03:01
|
||||
|
||||
|
||||
- Change JSON parser from circular-json to flatted & 1 more changes ([#37](https://github.com/royriojas/flat-cache/issues/37)) - [745e65a]( https://github.com/royriojas/flat-cache/commit/745e65a ), [Andy Chen](https://github.com/Andy Chen), 08/01/2019 19:17:20
|
||||
|
||||
* Change JSON parser from circular-json to flatted & 1 more changes
|
||||
|
||||
* Change JSON parser from circular-json
|
||||
* Audited 2 vulnerabilities
|
||||
|
||||
* Update package.json
|
||||
|
||||
* Update Engine require
|
||||
|
||||
* There's a bunch of dependencies in this pkg requires node >=4, so I changed it to 4
|
||||
|
||||
* Remove and add node versions
|
||||
|
||||
* I have seen this pkg is not available with node 0.12 so I removed it
|
||||
* I have added a popular used LTS version of node - 10
|
||||
|
||||
## v1.3.4
|
||||
- **Refactoring**
|
||||
- Add del.js and utils.js to the list of files to be beautified - [9d0ca9b]( https://github.com/royriojas/flat-cache/commit/9d0ca9b ), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 15:19:02
|
||||
|
||||
|
||||
## v1.3.3
|
||||
- **Refactoring**
|
||||
- Make sure package-lock.json is up to date - [a7d2598]( https://github.com/royriojas/flat-cache/commit/a7d2598 ), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 14:36:08
|
||||
|
||||
|
||||
- **Other changes**
|
||||
- Removed the need for del ([#33](https://github.com/royriojas/flat-cache/issues/33)) - [c429012]( https://github.com/royriojas/flat-cache/commit/c429012 ), [S. Gilroy](https://github.com/S. Gilroy), 13/11/2018 16:56:37
|
||||
|
||||
* Removed the need for del
|
||||
|
||||
Removed the need for del as newer versions have broken backwards
|
||||
compatibility. del mainly uses rimraf for deleting folders
|
||||
and files, replaceing it with rimraf only is a minimal change.
|
||||
|
||||
* Disable glob on rimraf calls
|
||||
|
||||
* Added glob disable to wrong call
|
||||
|
||||
* Wrapped rimraf to simplify solution
|
||||
|
||||
## v1.3.2
|
||||
- **Refactoring**
|
||||
- remove yarn.lock file - [704c6c4]( https://github.com/royriojas/flat-cache/commit/704c6c4 ), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 18:41:08
|
||||
|
||||
|
||||
- **undefined**
|
||||
- replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23))" - [db12d74]( https://github.com/royriojas/flat-cache/commit/db12d74 ), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 18:40:39
|
||||
|
||||
This reverts commit 00f689277a75e85fef28e6a048fad227afc525e6.
|
||||
|
||||
## v1.3.1
|
||||
- **Refactoring**
|
||||
- upgrade deps to remove some security warnings - [f405719]( https://github.com/royriojas/flat-cache/commit/f405719 ), [Roy Riojas](https://github.com/Roy Riojas), 06/11/2018 15:07:31
|
||||
|
||||
|
||||
- **Bug Fixes**
|
||||
- replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23)) - [00f6892]( https://github.com/royriojas/flat-cache/commit/00f6892 ), [Terry](https://github.com/Terry), 05/11/2018 21:44:16
|
||||
|
||||
|
||||
- **undefined**
|
||||
- update del to v3.0.0 ([#26](https://github.com/royriojas/flat-cache/issues/26)) - [d42883f]( https://github.com/royriojas/flat-cache/commit/d42883f ), [Patrick Silva](https://github.com/Patrick Silva), 03/11/2018 03:00:44
|
||||
|
||||
Closes <a target="_blank" class="info-link" href="https://github.com/royriojas/flat-cache/issues/25"><span>#25</span></a>
|
||||
## v1.3.0
|
||||
- **Other changes**
|
||||
- Added #all method ([#16](https://github.com/royriojas/flat-cache/issues/16)) - [12293be]( https://github.com/royriojas/flat-cache/commit/12293be ), [Ozair Patel](https://github.com/Ozair Patel), 25/09/2017 16:46:38
|
||||
|
||||
* Added #all method
|
||||
|
||||
* Added #all method test
|
||||
|
||||
* Updated readme
|
||||
|
||||
* Added yarn.lock
|
||||
|
||||
* Added more keys for #all test
|
||||
|
||||
* Beautified file
|
||||
|
||||
- fix changelog title style ([#14](https://github.com/royriojas/flat-cache/issues/14)) - [af8338a]( https://github.com/royriojas/flat-cache/commit/af8338a ), [前端小武](https://github.com/前端小武), 19/12/2016 23:34:48
|
||||
|
||||
|
||||
## v1.2.2
|
||||
- **Bug Fixes**
|
||||
- Do not crash if cache file is invalid JSON. ([#13](https://github.com/royriojas/flat-cache/issues/13)) - [87beaa6]( https://github.com/royriojas/flat-cache/commit/87beaa6 ), [Roy Riojas](https://github.com/Roy Riojas), 19/12/2016 21:03:35
|
||||
|
||||
Fixes <a target="_blank" class="info-link" href="https://github.com/royriojas/flat-cache/issues/12"><span>#12</span></a>
|
||||
|
||||
Not sure under which situations a cache file might exist that does
|
||||
not contain a valid JSON structure, but just in case to cover
|
||||
the possibility of this happening a try catch block has been added
|
||||
|
||||
If the cache is somehow not valid the cache will be discarded an a
|
||||
a new cache will be stored instead
|
||||
- **Other changes**
|
||||
- Added travis ci support for modern node versions ([#11](https://github.com/royriojas/flat-cache/issues/11)) - [1c2b1f7]( https://github.com/royriojas/flat-cache/commit/1c2b1f7 ), [Amila Welihinda](https://github.com/Amila Welihinda), 11/11/2016 02:47:52
|
||||
|
||||
|
||||
- Bumping `circular-son` version ([#10](https://github.com/royriojas/flat-cache/issues/10)) - [4d5e861]( https://github.com/royriojas/flat-cache/commit/4d5e861 ), [Andrea Giammarchi](https://github.com/Andrea Giammarchi), 02/08/2016 09:13:52
|
||||
|
||||
As mentioned in https://github.com/WebReflection/circular-json/issues/25 `circular-json` wan't rightly implementing the license field.
|
||||
|
||||
Latest version bump changed only that bit so that ESLint should now be happy.
|
||||
## 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.1.0
|
||||
- **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
|
||||
|
||||
|
||||
- add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 18:04:08
|
||||
|
||||
|
||||
- make sure the test script also verify beautification and linting of files before running tests - [e94e176]( https://github.com/royriojas/flat-cache/commit/e94e176 ), [royriojas](https://github.com/royriojas), 01/11/2015 14:54:48
|
||||
|
||||
|
||||
- **Other changes**
|
||||
- add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 23:02:18
|
||||
|
||||
|
||||
## v1.0.9
|
||||
- **Bug Fixes**
|
||||
- wrong default values for changelogx user repo name - [7bb52d1]( https://github.com/royriojas/flat-cache/commit/7bb52d1 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:59:30
|
||||
|
||||
|
||||
## v1.0.8
|
||||
- **Build Scripts Changes**
|
||||
- test against node 4 - [c395b66]( https://github.com/royriojas/flat-cache/commit/c395b66 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:51:39
|
||||
|
||||
|
||||
## v1.0.7
|
||||
- **Other changes**
|
||||
- Move dependencies into devDep - [7e47099]( https://github.com/royriojas/flat-cache/commit/7e47099 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 17:10:57
|
||||
|
||||
|
||||
- **Documentation**
|
||||
- Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 16:48:05
|
||||
|
||||
|
||||
## v1.0.6
|
||||
- **Build Scripts Changes**
|
||||
- Add helpers/code check scripts - [bdb82f3]( https://github.com/royriojas/flat-cache/commit/bdb82f3 ), [royriojas](https://github.com/royriojas), 11/09/2015 16:44:31
|
||||
|
||||
|
||||
## v1.0.5
|
||||
- **Documentation**
|
||||
- better description for the module - [436817f]( https://github.com/royriojas/flat-cache/commit/436817f ), [royriojas](https://github.com/royriojas), 11/09/2015 16:35:33
|
||||
|
||||
|
||||
- **Other changes**
|
||||
- Update dependencies - [be88aa3]( https://github.com/royriojas/flat-cache/commit/be88aa3 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:47:41
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
|
||||
- make sure the test script also verify beautification and linting of files before running tests - [e94e176]( https://github.com/royriojas/flat-cache/commit/e94e176 ), [royriojas](https://github.com/royriojas), 01/11/2015 14:54:48
|
||||
|
||||
|
||||
- test against node 4 - [c395b66]( https://github.com/royriojas/flat-cache/commit/c395b66 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:51:39
|
||||
|
||||
|
||||
- Add helpers/code check scripts - [bdb82f3]( https://github.com/royriojas/flat-cache/commit/bdb82f3 ), [royriojas](https://github.com/royriojas), 11/09/2015 16:44:31
|
||||
|
||||
|
||||
- **Other changes**
|
||||
- add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 23:02:18
|
||||
|
||||
|
||||
- Move dependencies into devDep - [7e47099]( https://github.com/royriojas/flat-cache/commit/7e47099 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 17:10:57
|
||||
|
||||
|
||||
- Update dependencies - [be88aa3]( https://github.com/royriojas/flat-cache/commit/be88aa3 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:47:41
|
||||
|
||||
|
||||
- **Bug Fixes**
|
||||
- wrong default values for changelogx user repo name - [7bb52d1]( https://github.com/royriojas/flat-cache/commit/7bb52d1 ), [royriojas](https://github.com/royriojas), 11/09/2015 17:59:30
|
||||
|
||||
|
||||
- **Documentation**
|
||||
- Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 16:48:05
|
||||
|
||||
|
||||
- better description for the module - [436817f]( https://github.com/royriojas/flat-cache/commit/436817f ), [royriojas](https://github.com/royriojas), 11/09/2015 16:35:33
|
||||
|
||||
|
||||
- Add documentation about `clearAll` and `clearCacheById` - [13947c1]( https://github.com/royriojas/flat-cache/commit/13947c1 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 02:44:05
|
||||
|
||||
|
||||
- **Refactoring**
|
||||
- load a cache file using the full filepath - [b8f68c2]( https://github.com/royriojas/flat-cache/commit/b8f68c2 ), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 06:19:14
|
||||
|
||||
|
||||
- **Features**
|
||||
- Add methods to remove the cache documents created - [af40443]( https://github.com/royriojas/flat-cache/commit/af40443 ), [Roy Riojas](https://github.com/Roy Riojas), 02/03/2015 02:39:27
|
||||
|
||||
|
||||
## v1.0.1
|
||||
- **Other changes**
|
||||
- Update README.md - [c2b6805]( https://github.com/royriojas/flat-cache/commit/c2b6805 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 07:28:07
|
||||
|
||||
|
||||
## v1.0.0
|
||||
- **Refactoring**
|
||||
- flat-cache v.1.0.0 - [c984274]( https://github.com/royriojas/flat-cache/commit/c984274 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 07:11:50
|
||||
|
||||
|
||||
- **Other changes**
|
||||
- Initial commit - [d43cccf]( https://github.com/royriojas/flat-cache/commit/d43cccf ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:12:16
|
||||
|
||||
|
13
buildfiles/app/node_modules/flat-cache/del.js
generated
vendored
Normal file
13
buildfiles/app/node_modules/flat-cache/del.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
var rimraf = require( 'rimraf' ).sync;
|
||||
var fs = require( 'fs' );
|
||||
|
||||
module.exports = function del( file ) {
|
||||
if ( fs.existsSync( file ) ) {
|
||||
//if rimraf doesn't throw then the file has been deleted or didn't exist
|
||||
rimraf( file, {
|
||||
glob: false
|
||||
} );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
123
buildfiles/app/node_modules/flat-cache/package.json
generated
vendored
Normal file
123
buildfiles/app/node_modules/flat-cache/package.json
generated
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"flat-cache@2.0.1",
|
||||
"/home/shihaam/www/freezer.shihaam.me/app"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "flat-cache@2.0.1",
|
||||
"_id": "flat-cache@2.0.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==",
|
||||
"_location": "/flat-cache",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "flat-cache@2.0.1",
|
||||
"name": "flat-cache",
|
||||
"escapedName": "flat-cache",
|
||||
"rawSpec": "2.0.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.0.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/file-entry-cache"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
|
||||
"_spec": "2.0.1",
|
||||
"_where": "/home/shihaam/www/freezer.shihaam.me/app",
|
||||
"author": {
|
||||
"name": "Roy Riojas",
|
||||
"url": "http://royriojas.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/royriojas/flat-cache/issues"
|
||||
},
|
||||
"changelogx": {
|
||||
"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": {
|
||||
"flatted": "^2.0.0",
|
||||
"rimraf": "2.6.3",
|
||||
"write": "1.0.3"
|
||||
},
|
||||
"description": "A stupidly simple key/value storage using files to persist some data",
|
||||
"devDependencies": {
|
||||
"chai": "^3.2.0",
|
||||
"changelogx": "3.0.0",
|
||||
"esbeautifier": "10.1.1",
|
||||
"eslinter": "^3.2.1",
|
||||
"glob-expand": "0.2.1",
|
||||
"istanbul": "0.4.5",
|
||||
"mocha": "5.2.0",
|
||||
"precommit": "^1.1.5",
|
||||
"prepush": "^3.1.4",
|
||||
"proxyquire": "^1.7.2",
|
||||
"sinon": "^1.16.1",
|
||||
"sinon-chai": "^2.8.0",
|
||||
"watch-run": "^1.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"files": [
|
||||
"cache.js",
|
||||
"utils.js",
|
||||
"del.js"
|
||||
],
|
||||
"homepage": "https://github.com/royriojas/flat-cache#readme",
|
||||
"keywords": [
|
||||
"json cache",
|
||||
"simple cache",
|
||||
"file cache",
|
||||
"key par",
|
||||
"key value",
|
||||
"cache"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "cache.js",
|
||||
"name": "flat-cache",
|
||||
"precommit": [
|
||||
"npm run verify --silent"
|
||||
],
|
||||
"prepush": [
|
||||
"npm run verify --silent"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/royriojas/flat-cache.git"
|
||||
},
|
||||
"scripts": {
|
||||
"autofix": "npm run beautify && npm run eslint-fix",
|
||||
"beautify": "esbeautifier 'cache.js' 'utils.js' 'del.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",
|
||||
"bump-patch": "npm run pre-v && npm version patch -m 'BLD: Release v%s' && npm run post-v",
|
||||
"changelog": "changelogx -f markdown -o ./changelog.md",
|
||||
"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' 'utils.js' 'del.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",
|
||||
"pre-v": "npm run verify",
|
||||
"test": "npm run verify --silent",
|
||||
"test:cache": "mocha -R spec test/specs",
|
||||
"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": "2.0.1"
|
||||
}
|
39
buildfiles/app/node_modules/flat-cache/utils.js
generated
vendored
Normal file
39
buildfiles/app/node_modules/flat-cache/utils.js
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
var fs = require( 'fs' );
|
||||
var write = require( 'write' );
|
||||
var flatted = require( 'flatted' );
|
||||
|
||||
module.exports = {
|
||||
tryParse: function ( filePath, defaultValue ) {
|
||||
var result;
|
||||
try {
|
||||
result = this.readJSON( filePath );
|
||||
} catch (ex) {
|
||||
result = defaultValue;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* Read json file synchronously using flatted
|
||||
*
|
||||
* @method readJSON
|
||||
* @param {String} filePath Json filepath
|
||||
* @returns {*} parse result
|
||||
*/
|
||||
readJSON: function ( filePath ) {
|
||||
return flatted.parse( fs.readFileSync( filePath, {
|
||||
encoding: 'utf8'
|
||||
} ) );
|
||||
},
|
||||
|
||||
/**
|
||||
* 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, flatted.stringify( data ) );
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user