Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
2
node_modules/flat-cache/README.md
generated
vendored
2
node_modules/flat-cache/README.md
generated
vendored
|
|
@ -2,7 +2,7 @@
|
|||
> 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)
|
||||
[](https://travis-ci.org/royriojas/flat-cache)
|
||||
|
||||
## install
|
||||
|
||||
|
|
|
|||
284
node_modules/flat-cache/changelog.md
generated
vendored
284
node_modules/flat-cache/changelog.md
generated
vendored
|
|
@ -1,23 +1,113 @@
|
|||
|
||||
# flat-cache - Changelog
|
||||
## v3.0.4
|
||||
- **Refactoring**
|
||||
- add files by name to the list of exported files - [89a2698]( https://github.com/royriojas/flat-cache/commit/89a2698 ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:35:39
|
||||
|
||||
|
||||
## v3.0.3
|
||||
- **Bug Fixes**
|
||||
- Fix wrong eslint command - [f268e42]( https://github.com/royriojas/flat-cache/commit/f268e42 ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:15:04
|
||||
|
||||
|
||||
## v3.0.2
|
||||
- **Refactoring**
|
||||
- Update the files paths - [6983a80]( https://github.com/royriojas/flat-cache/commit/6983a80 ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:58:39
|
||||
|
||||
|
||||
- Move code to src/ - [18ed6e8]( https://github.com/royriojas/flat-cache/commit/18ed6e8 ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:57:17
|
||||
|
||||
|
||||
- Change eslint-cache location - [beed74c]( https://github.com/royriojas/flat-cache/commit/beed74c ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:48:32
|
||||
|
||||
|
||||
## v3.0.1
|
||||
- **Refactoring**
|
||||
- Remove unused deps - [8c6d9dc]( https://github.com/royriojas/flat-cache/commit/8c6d9dc ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:43:29
|
||||
|
||||
|
||||
## v3.0.0
|
||||
- **Refactoring**
|
||||
- Fix engines - [52b824c]( https://github.com/royriojas/flat-cache/commit/52b824c ), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:01:52
|
||||
|
||||
|
||||
- **Other changes**
|
||||
- Replace write with combination of mkdir and writeFile ([#49](https://github.com/royriojas/flat-cache/issues/49)) - [ef48276]( https://github.com/royriojas/flat-cache/commit/ef48276 ), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 08/11/2020 00:17:15
|
||||
|
||||
Node v10 introduced a great "recursive" option for mkdir which allows to
|
||||
get rid from mkdirp package and easily rewrite "write" package usage
|
||||
with two function calls.
|
||||
|
||||
https://nodejs.org/api/fs.html#fs_fs_mkdir_path_options_callback
|
||||
- Added a testcase for clearAll ([#48](https://github.com/royriojas/flat-cache/issues/48)) - [45b51ca]( https://github.com/royriojas/flat-cache/commit/45b51ca ), [Aaron Chen](https://github.com/Aaron Chen), 21/05/2020 08:40:03
|
||||
|
||||
|
||||
- requet node>=10 - [a5c482c]( https://github.com/royriojas/flat-cache/commit/a5c482c ), [yumetodo](https://github.com/yumetodo), 10/04/2020 23:14:53
|
||||
|
||||
thanks @SuperITMan
|
||||
|
||||
- Update README.md - [29fe40b]( https://github.com/royriojas/flat-cache/commit/29fe40b ), [Roy Riojas](https://github.com/Roy Riojas), 10/04/2020 20:08:05
|
||||
|
||||
|
||||
- reduce vulnerability to 1 - [e9db1b2]( https://github.com/royriojas/flat-cache/commit/e9db1b2 ), [yumetodo](https://github.com/yumetodo), 30/03/2020 11:10:43
|
||||
|
||||
|
||||
- reduce vulnerabilities dependencies to 8 - [b58d196]( https://github.com/royriojas/flat-cache/commit/b58d196 ), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:54:56
|
||||
|
||||
|
||||
- use prettier instead of esbeautifier - [03b1db7]( https://github.com/royriojas/flat-cache/commit/03b1db7 ), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:27:14
|
||||
|
||||
|
||||
- update proxyquire - [c2f048d]( https://github.com/royriojas/flat-cache/commit/c2f048d ), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:16:16
|
||||
|
||||
|
||||
- update flatted and mocha - [a0e56da]( https://github.com/royriojas/flat-cache/commit/a0e56da ), [yumetodo](https://github.com/yumetodo), 30/03/2020 09:46:45
|
||||
|
||||
mocha > mkdirp is updated
|
||||
istanble >>> optimist > minimist is not updated
|
||||
|
||||
- drop support node.js < 10 in develop - [beba691]( https://github.com/royriojas/flat-cache/commit/beba691 ), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:31:09
|
||||
|
||||
see mkdirp
|
||||
|
||||
- npm aufit fix(still remains) - [ce166cb]( https://github.com/royriojas/flat-cache/commit/ce166cb ), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:18:08
|
||||
|
||||
37 vulnerabilities required manual review and could not be updated
|
||||
|
||||
- updtate sinon - [9f2d1b6]( https://github.com/royriojas/flat-cache/commit/9f2d1b6 ), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:17:51
|
||||
|
||||
|
||||
- apply eslint-plugin-mocha - [07343b5]( https://github.com/royriojas/flat-cache/commit/07343b5 ), [yumetodo](https://github.com/yumetodo), 13/03/2020 22:17:21
|
||||
|
||||
|
||||
- Less strint version check ([#44](https://github.com/royriojas/flat-cache/issues/44)) - [92aca1c]( https://github.com/royriojas/flat-cache/commit/92aca1c ), [Wojciech Maj](https://github.com/Wojciech Maj), 13/11/2019 16:18:25
|
||||
|
||||
* Use ^ version matching for production dependencies
|
||||
|
||||
* Run npm audit fix
|
||||
|
||||
- **Bug Fixes**
|
||||
- update dependencies and use eslint directly - [73fbed2]( https://github.com/royriojas/flat-cache/commit/73fbed2 ), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:17:27
|
||||
|
||||
|
||||
## 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
|
||||
- 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 18: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
|
||||
- upgrade package.json lock file - [8d21c7b]( https://github.com/royriojas/flat-cache/commit/8d21c7b ), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 17: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
|
||||
- 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 16: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
|
||||
- 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 17: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 ([#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 16:17:20
|
||||
|
||||
* Change JSON parser from circular-json to flatted & 1 more changes
|
||||
|
||||
|
|
@ -37,16 +127,16 @@
|
|||
|
||||
## 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
|
||||
- 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 12: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
|
||||
- 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 11: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 ([#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 13:56:37
|
||||
|
||||
* Removed the need for del
|
||||
|
||||
|
|
@ -62,30 +152,30 @@
|
|||
|
||||
## 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
|
||||
- remove yarn.lock file - [704c6c4]( https://github.com/royriojas/flat-cache/commit/704c6c4 ), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15: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
|
||||
- **Other changes**
|
||||
- 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 15: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
|
||||
- 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 12: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
|
||||
- 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 18: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
|
||||
- **Other changes**
|
||||
- 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 01: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 ([#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 14:46:38
|
||||
|
||||
* Added #all method
|
||||
|
||||
|
|
@ -99,12 +189,12 @@
|
|||
|
||||
* 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
|
||||
- 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 20: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
|
||||
- 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 18:03:35
|
||||
|
||||
Fixes <a target="_blank" class="info-link" href="https://github.com/royriojas/flat-cache/issues/12"><span>#12</span></a>
|
||||
|
||||
|
|
@ -115,186 +205,124 @@
|
|||
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
|
||||
- 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), 10/11/2016 23: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
|
||||
- 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 07: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
|
||||
- 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 02: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
|
||||
- Add documentation about noPrune option - [23e11f9]( https://github.com/royriojas/flat-cache/commit/23e11f9 ), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02: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 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 02: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
|
||||
- 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 08: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
|
||||
- Remove UTF16 BOM stripping - [4a41e22]( https://github.com/royriojas/flat-cache/commit/4a41e22 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02: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
|
||||
- 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 11: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 missing file from eslint test - [d6fa3c3]( https://github.com/royriojas/flat-cache/commit/d6fa3c3 ), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02: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
|
||||
- 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 08: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
|
||||
- Remove unused read-json-sync - [2be1c24]( https://github.com/royriojas/flat-cache/commit/2be1c24 ), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08: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
|
||||
- travis tests on 0.12 and 4x - [3a613fd]( https://github.com/royriojas/flat-cache/commit/3a613fd ), [royriojas](https://github.com/royriojas), 15/11/2015 14: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
|
||||
- add eslint-fix task - [fd29e52]( https://github.com/royriojas/flat-cache/commit/fd29e52 ), [royriojas](https://github.com/royriojas), 01/11/2015 15: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
|
||||
- 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 11: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
|
||||
|
||||
|
||||
- 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
|
||||
- add clearAll for cacheDir - [97383d9]( https://github.com/royriojas/flat-cache/commit/97383d9 ), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 21: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
|
||||
- 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 15: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 15: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 15: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
|
||||
- Add missing changelog link - [f51197a]( https://github.com/royriojas/flat-cache/commit/f51197a ), [royriojas](https://github.com/royriojas), 11/09/2015 14: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
|
||||
## 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 14:44:31
|
||||
|
||||
|
||||
- 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
|
||||
## 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 14: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 13:47:41
|
||||
|
||||
|
||||
## v1.0.4
|
||||
- **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
|
||||
- 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 04:19:14
|
||||
|
||||
|
||||
- **Documentation**
|
||||
- Add documentation about `clearAll` and `clearCacheById` - [13947c1]( https://github.com/royriojas/flat-cache/commit/13947c1 ), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:44:05
|
||||
|
||||
|
||||
- **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
|
||||
- Add methods to remove the cache documents created - [af40443]( https://github.com/royriojas/flat-cache/commit/af40443 ), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23: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
|
||||
- Update README.md - [c2b6805]( https://github.com/royriojas/flat-cache/commit/c2b6805 ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04: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
|
||||
- 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 04: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
|
||||
- Initial commit - [d43cccf]( https://github.com/royriojas/flat-cache/commit/d43cccf ), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 01:12:16
|
||||
|
||||
|
||||
|
|
|
|||
13
node_modules/flat-cache/del.js
generated
vendored
13
node_modules/flat-cache/del.js
generated
vendored
|
|
@ -1,13 +0,0 @@
|
|||
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;
|
||||
};
|
||||
1
node_modules/flat-cache/node_modules/.bin/rimraf
generated
vendored
1
node_modules/flat-cache/node_modules/.bin/rimraf
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
../rimraf/bin.js
|
||||
15
node_modules/flat-cache/node_modules/rimraf/LICENSE
generated
vendored
15
node_modules/flat-cache/node_modules/rimraf/LICENSE
generated
vendored
|
|
@ -1,15 +0,0 @@
|
|||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
101
node_modules/flat-cache/node_modules/rimraf/README.md
generated
vendored
101
node_modules/flat-cache/node_modules/rimraf/README.md
generated
vendored
|
|
@ -1,101 +0,0 @@
|
|||
[](https://travis-ci.org/isaacs/rimraf) [](https://david-dm.org/isaacs/rimraf) [](https://david-dm.org/isaacs/rimraf#info=devDependencies)
|
||||
|
||||
The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
|
||||
|
||||
Install with `npm install rimraf`, or just drop rimraf.js somewhere.
|
||||
|
||||
## API
|
||||
|
||||
`rimraf(f, [opts], callback)`
|
||||
|
||||
The first parameter will be interpreted as a globbing pattern for files. If you
|
||||
want to disable globbing you can do so with `opts.disableGlob` (defaults to
|
||||
`false`). This might be handy, for instance, if you have filenames that contain
|
||||
globbing wildcard characters.
|
||||
|
||||
The callback will be called with an error if there is one. Certain
|
||||
errors are handled for you:
|
||||
|
||||
* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of
|
||||
`opts.maxBusyTries` times before giving up, adding 100ms of wait
|
||||
between each attempt. The default `maxBusyTries` is 3.
|
||||
* `ENOENT` - If the file doesn't exist, rimraf will return
|
||||
successfully, since your desired outcome is already the case.
|
||||
* `EMFILE` - Since `readdir` requires opening a file descriptor, it's
|
||||
possible to hit `EMFILE` if too many file descriptors are in use.
|
||||
In the sync case, there's nothing to be done for this. But in the
|
||||
async case, rimraf will gradually back off with timeouts up to
|
||||
`opts.emfileWait` ms, which defaults to 1000.
|
||||
|
||||
## options
|
||||
|
||||
* unlink, chmod, stat, lstat, rmdir, readdir,
|
||||
unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync
|
||||
|
||||
In order to use a custom file system library, you can override
|
||||
specific fs functions on the options object.
|
||||
|
||||
If any of these functions are present on the options object, then
|
||||
the supplied function will be used instead of the default fs
|
||||
method.
|
||||
|
||||
Sync methods are only relevant for `rimraf.sync()`, of course.
|
||||
|
||||
For example:
|
||||
|
||||
```javascript
|
||||
var myCustomFS = require('some-custom-fs')
|
||||
|
||||
rimraf('some-thing', myCustomFS, callback)
|
||||
```
|
||||
|
||||
* maxBusyTries
|
||||
|
||||
If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered
|
||||
on Windows systems, then rimraf will retry with a linear backoff
|
||||
wait of 100ms longer on each try. The default maxBusyTries is 3.
|
||||
|
||||
Only relevant for async usage.
|
||||
|
||||
* emfileWait
|
||||
|
||||
If an `EMFILE` error is encountered, then rimraf will retry
|
||||
repeatedly with a linear backoff of 1ms longer on each try, until
|
||||
the timeout counter hits this max. The default limit is 1000.
|
||||
|
||||
If you repeatedly encounter `EMFILE` errors, then consider using
|
||||
[graceful-fs](http://npm.im/graceful-fs) in your program.
|
||||
|
||||
Only relevant for async usage.
|
||||
|
||||
* glob
|
||||
|
||||
Set to `false` to disable [glob](http://npm.im/glob) pattern
|
||||
matching.
|
||||
|
||||
Set to an object to pass options to the glob module. The default
|
||||
glob options are `{ nosort: true, silent: true }`.
|
||||
|
||||
Glob version 6 is used in this module.
|
||||
|
||||
Relevant for both sync and async usage.
|
||||
|
||||
* disableGlob
|
||||
|
||||
Set to any non-falsey value to disable globbing entirely.
|
||||
(Equivalent to setting `glob: false`.)
|
||||
|
||||
## rimraf.sync
|
||||
|
||||
It can remove stuff synchronously, too. But that's not so good. Use
|
||||
the async API. It's better.
|
||||
|
||||
## CLI
|
||||
|
||||
If installed with `npm install rimraf -g` it can be used as a global
|
||||
command `rimraf <path> [<path> ...]` which is useful for cross platform support.
|
||||
|
||||
## mkdirp
|
||||
|
||||
If you need to create a directory recursively, check out
|
||||
[mkdirp](https://github.com/substack/node-mkdirp).
|
||||
50
node_modules/flat-cache/node_modules/rimraf/bin.js
generated
vendored
50
node_modules/flat-cache/node_modules/rimraf/bin.js
generated
vendored
|
|
@ -1,50 +0,0 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var rimraf = require('./')
|
||||
|
||||
var help = false
|
||||
var dashdash = false
|
||||
var noglob = false
|
||||
var args = process.argv.slice(2).filter(function(arg) {
|
||||
if (dashdash)
|
||||
return !!arg
|
||||
else if (arg === '--')
|
||||
dashdash = true
|
||||
else if (arg === '--no-glob' || arg === '-G')
|
||||
noglob = true
|
||||
else if (arg === '--glob' || arg === '-g')
|
||||
noglob = false
|
||||
else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
|
||||
help = true
|
||||
else
|
||||
return !!arg
|
||||
})
|
||||
|
||||
if (help || args.length === 0) {
|
||||
// If they didn't ask for help, then this is not a "success"
|
||||
var log = help ? console.log : console.error
|
||||
log('Usage: rimraf <path> [<path> ...]')
|
||||
log('')
|
||||
log(' Deletes all files and folders at "path" recursively.')
|
||||
log('')
|
||||
log('Options:')
|
||||
log('')
|
||||
log(' -h, --help Display this usage info')
|
||||
log(' -G, --no-glob Do not expand glob patterns in arguments')
|
||||
log(' -g, --glob Expand glob patterns in arguments (default)')
|
||||
process.exit(help ? 0 : 1)
|
||||
} else
|
||||
go(0)
|
||||
|
||||
function go (n) {
|
||||
if (n >= args.length)
|
||||
return
|
||||
var options = {}
|
||||
if (noglob)
|
||||
options = { glob: false }
|
||||
rimraf(args[n], options, function (er) {
|
||||
if (er)
|
||||
throw er
|
||||
go(n+1)
|
||||
})
|
||||
}
|
||||
29
node_modules/flat-cache/node_modules/rimraf/package.json
generated
vendored
29
node_modules/flat-cache/node_modules/rimraf/package.json
generated
vendored
|
|
@ -1,29 +0,0 @@
|
|||
{
|
||||
"name": "rimraf",
|
||||
"version": "2.6.3",
|
||||
"main": "rimraf.js",
|
||||
"description": "A deep deletion module for node (like `rm -rf`)",
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"license": "ISC",
|
||||
"repository": "git://github.com/isaacs/rimraf.git",
|
||||
"scripts": {
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"postpublish": "git push origin --all; git push origin --tags",
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"bin": "./bin.js",
|
||||
"dependencies": {
|
||||
"glob": "^7.1.3"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"bin.js",
|
||||
"rimraf.js"
|
||||
],
|
||||
"devDependencies": {
|
||||
"mkdirp": "^0.5.1",
|
||||
"tap": "^12.1.1"
|
||||
}
|
||||
}
|
||||
364
node_modules/flat-cache/node_modules/rimraf/rimraf.js
generated
vendored
364
node_modules/flat-cache/node_modules/rimraf/rimraf.js
generated
vendored
|
|
@ -1,364 +0,0 @@
|
|||
module.exports = rimraf
|
||||
rimraf.sync = rimrafSync
|
||||
|
||||
var assert = require("assert")
|
||||
var path = require("path")
|
||||
var fs = require("fs")
|
||||
var glob = require("glob")
|
||||
var _0666 = parseInt('666', 8)
|
||||
|
||||
var defaultGlobOpts = {
|
||||
nosort: true,
|
||||
silent: true
|
||||
}
|
||||
|
||||
// for EMFILE handling
|
||||
var timeout = 0
|
||||
|
||||
var isWindows = (process.platform === "win32")
|
||||
|
||||
function defaults (options) {
|
||||
var methods = [
|
||||
'unlink',
|
||||
'chmod',
|
||||
'stat',
|
||||
'lstat',
|
||||
'rmdir',
|
||||
'readdir'
|
||||
]
|
||||
methods.forEach(function(m) {
|
||||
options[m] = options[m] || fs[m]
|
||||
m = m + 'Sync'
|
||||
options[m] = options[m] || fs[m]
|
||||
})
|
||||
|
||||
options.maxBusyTries = options.maxBusyTries || 3
|
||||
options.emfileWait = options.emfileWait || 1000
|
||||
if (options.glob === false) {
|
||||
options.disableGlob = true
|
||||
}
|
||||
options.disableGlob = options.disableGlob || false
|
||||
options.glob = options.glob || defaultGlobOpts
|
||||
}
|
||||
|
||||
function rimraf (p, options, cb) {
|
||||
if (typeof options === 'function') {
|
||||
cb = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
assert(p, 'rimraf: missing path')
|
||||
assert.equal(typeof p, 'string', 'rimraf: path should be a string')
|
||||
assert.equal(typeof cb, 'function', 'rimraf: callback function required')
|
||||
assert(options, 'rimraf: invalid options argument provided')
|
||||
assert.equal(typeof options, 'object', 'rimraf: options should be object')
|
||||
|
||||
defaults(options)
|
||||
|
||||
var busyTries = 0
|
||||
var errState = null
|
||||
var n = 0
|
||||
|
||||
if (options.disableGlob || !glob.hasMagic(p))
|
||||
return afterGlob(null, [p])
|
||||
|
||||
options.lstat(p, function (er, stat) {
|
||||
if (!er)
|
||||
return afterGlob(null, [p])
|
||||
|
||||
glob(p, options.glob, afterGlob)
|
||||
})
|
||||
|
||||
function next (er) {
|
||||
errState = errState || er
|
||||
if (--n === 0)
|
||||
cb(errState)
|
||||
}
|
||||
|
||||
function afterGlob (er, results) {
|
||||
if (er)
|
||||
return cb(er)
|
||||
|
||||
n = results.length
|
||||
if (n === 0)
|
||||
return cb()
|
||||
|
||||
results.forEach(function (p) {
|
||||
rimraf_(p, options, function CB (er) {
|
||||
if (er) {
|
||||
if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
|
||||
busyTries < options.maxBusyTries) {
|
||||
busyTries ++
|
||||
var time = busyTries * 100
|
||||
// try again, with the same exact callback as this one.
|
||||
return setTimeout(function () {
|
||||
rimraf_(p, options, CB)
|
||||
}, time)
|
||||
}
|
||||
|
||||
// this one won't happen if graceful-fs is used.
|
||||
if (er.code === "EMFILE" && timeout < options.emfileWait) {
|
||||
return setTimeout(function () {
|
||||
rimraf_(p, options, CB)
|
||||
}, timeout ++)
|
||||
}
|
||||
|
||||
// already gone
|
||||
if (er.code === "ENOENT") er = null
|
||||
}
|
||||
|
||||
timeout = 0
|
||||
next(er)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Two possible strategies.
|
||||
// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
|
||||
// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
|
||||
//
|
||||
// Both result in an extra syscall when you guess wrong. However, there
|
||||
// are likely far more normal files in the world than directories. This
|
||||
// is based on the assumption that a the average number of files per
|
||||
// directory is >= 1.
|
||||
//
|
||||
// If anyone ever complains about this, then I guess the strategy could
|
||||
// be made configurable somehow. But until then, YAGNI.
|
||||
function rimraf_ (p, options, cb) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
assert(typeof cb === 'function')
|
||||
|
||||
// sunos lets the root user unlink directories, which is... weird.
|
||||
// so we have to lstat here and make sure it's not a dir.
|
||||
options.lstat(p, function (er, st) {
|
||||
if (er && er.code === "ENOENT")
|
||||
return cb(null)
|
||||
|
||||
// Windows can EPERM on stat. Life is suffering.
|
||||
if (er && er.code === "EPERM" && isWindows)
|
||||
fixWinEPERM(p, options, er, cb)
|
||||
|
||||
if (st && st.isDirectory())
|
||||
return rmdir(p, options, er, cb)
|
||||
|
||||
options.unlink(p, function (er) {
|
||||
if (er) {
|
||||
if (er.code === "ENOENT")
|
||||
return cb(null)
|
||||
if (er.code === "EPERM")
|
||||
return (isWindows)
|
||||
? fixWinEPERM(p, options, er, cb)
|
||||
: rmdir(p, options, er, cb)
|
||||
if (er.code === "EISDIR")
|
||||
return rmdir(p, options, er, cb)
|
||||
}
|
||||
return cb(er)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function fixWinEPERM (p, options, er, cb) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
assert(typeof cb === 'function')
|
||||
if (er)
|
||||
assert(er instanceof Error)
|
||||
|
||||
options.chmod(p, _0666, function (er2) {
|
||||
if (er2)
|
||||
cb(er2.code === "ENOENT" ? null : er)
|
||||
else
|
||||
options.stat(p, function(er3, stats) {
|
||||
if (er3)
|
||||
cb(er3.code === "ENOENT" ? null : er)
|
||||
else if (stats.isDirectory())
|
||||
rmdir(p, options, er, cb)
|
||||
else
|
||||
options.unlink(p, cb)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function fixWinEPERMSync (p, options, er) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
if (er)
|
||||
assert(er instanceof Error)
|
||||
|
||||
try {
|
||||
options.chmodSync(p, _0666)
|
||||
} catch (er2) {
|
||||
if (er2.code === "ENOENT")
|
||||
return
|
||||
else
|
||||
throw er
|
||||
}
|
||||
|
||||
try {
|
||||
var stats = options.statSync(p)
|
||||
} catch (er3) {
|
||||
if (er3.code === "ENOENT")
|
||||
return
|
||||
else
|
||||
throw er
|
||||
}
|
||||
|
||||
if (stats.isDirectory())
|
||||
rmdirSync(p, options, er)
|
||||
else
|
||||
options.unlinkSync(p)
|
||||
}
|
||||
|
||||
function rmdir (p, options, originalEr, cb) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
if (originalEr)
|
||||
assert(originalEr instanceof Error)
|
||||
assert(typeof cb === 'function')
|
||||
|
||||
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
|
||||
// if we guessed wrong, and it's not a directory, then
|
||||
// raise the original error.
|
||||
options.rmdir(p, function (er) {
|
||||
if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
|
||||
rmkids(p, options, cb)
|
||||
else if (er && er.code === "ENOTDIR")
|
||||
cb(originalEr)
|
||||
else
|
||||
cb(er)
|
||||
})
|
||||
}
|
||||
|
||||
function rmkids(p, options, cb) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
assert(typeof cb === 'function')
|
||||
|
||||
options.readdir(p, function (er, files) {
|
||||
if (er)
|
||||
return cb(er)
|
||||
var n = files.length
|
||||
if (n === 0)
|
||||
return options.rmdir(p, cb)
|
||||
var errState
|
||||
files.forEach(function (f) {
|
||||
rimraf(path.join(p, f), options, function (er) {
|
||||
if (errState)
|
||||
return
|
||||
if (er)
|
||||
return cb(errState = er)
|
||||
if (--n === 0)
|
||||
options.rmdir(p, cb)
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// this looks simpler, and is strictly *faster*, but will
|
||||
// tie up the JavaScript thread and fail on excessively
|
||||
// deep directory trees.
|
||||
function rimrafSync (p, options) {
|
||||
options = options || {}
|
||||
defaults(options)
|
||||
|
||||
assert(p, 'rimraf: missing path')
|
||||
assert.equal(typeof p, 'string', 'rimraf: path should be a string')
|
||||
assert(options, 'rimraf: missing options')
|
||||
assert.equal(typeof options, 'object', 'rimraf: options should be object')
|
||||
|
||||
var results
|
||||
|
||||
if (options.disableGlob || !glob.hasMagic(p)) {
|
||||
results = [p]
|
||||
} else {
|
||||
try {
|
||||
options.lstatSync(p)
|
||||
results = [p]
|
||||
} catch (er) {
|
||||
results = glob.sync(p, options.glob)
|
||||
}
|
||||
}
|
||||
|
||||
if (!results.length)
|
||||
return
|
||||
|
||||
for (var i = 0; i < results.length; i++) {
|
||||
var p = results[i]
|
||||
|
||||
try {
|
||||
var st = options.lstatSync(p)
|
||||
} catch (er) {
|
||||
if (er.code === "ENOENT")
|
||||
return
|
||||
|
||||
// Windows can EPERM on stat. Life is suffering.
|
||||
if (er.code === "EPERM" && isWindows)
|
||||
fixWinEPERMSync(p, options, er)
|
||||
}
|
||||
|
||||
try {
|
||||
// sunos lets the root user unlink directories, which is... weird.
|
||||
if (st && st.isDirectory())
|
||||
rmdirSync(p, options, null)
|
||||
else
|
||||
options.unlinkSync(p)
|
||||
} catch (er) {
|
||||
if (er.code === "ENOENT")
|
||||
return
|
||||
if (er.code === "EPERM")
|
||||
return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
|
||||
if (er.code !== "EISDIR")
|
||||
throw er
|
||||
|
||||
rmdirSync(p, options, er)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function rmdirSync (p, options, originalEr) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
if (originalEr)
|
||||
assert(originalEr instanceof Error)
|
||||
|
||||
try {
|
||||
options.rmdirSync(p)
|
||||
} catch (er) {
|
||||
if (er.code === "ENOENT")
|
||||
return
|
||||
if (er.code === "ENOTDIR")
|
||||
throw originalEr
|
||||
if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
|
||||
rmkidsSync(p, options)
|
||||
}
|
||||
}
|
||||
|
||||
function rmkidsSync (p, options) {
|
||||
assert(p)
|
||||
assert(options)
|
||||
options.readdirSync(p).forEach(function (f) {
|
||||
rimrafSync(path.join(p, f), options)
|
||||
})
|
||||
|
||||
// We only end up here once we got ENOTEMPTY at least once, and
|
||||
// at this point, we are guaranteed to have removed all the kids.
|
||||
// So, we know that it won't be ENOENT or ENOTDIR or anything else.
|
||||
// try really hard to delete stuff on windows, because it has a
|
||||
// PROFOUNDLY annoying habit of not closing handles promptly when
|
||||
// files are deleted, resulting in spurious ENOTEMPTY errors.
|
||||
var retries = isWindows ? 100 : 1
|
||||
var i = 0
|
||||
do {
|
||||
var threw = true
|
||||
try {
|
||||
var ret = options.rmdirSync(p, options)
|
||||
threw = false
|
||||
return ret
|
||||
} finally {
|
||||
if (++i < retries && threw)
|
||||
continue
|
||||
}
|
||||
} while (true)
|
||||
}
|
||||
53
node_modules/flat-cache/package.json
generated
vendored
53
node_modules/flat-cache/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "flat-cache",
|
||||
"version": "2.0.1",
|
||||
"version": "3.0.4",
|
||||
"description": "A stupidly simple key/value storage using files to persist some data",
|
||||
"repository": "royriojas/flat-cache",
|
||||
"license": "MIT",
|
||||
|
|
@ -8,14 +8,14 @@
|
|||
"name": "Roy Riojas",
|
||||
"url": "http://royriojas.com"
|
||||
},
|
||||
"main": "cache.js",
|
||||
"main": "src/cache.js",
|
||||
"files": [
|
||||
"cache.js",
|
||||
"utils.js",
|
||||
"del.js"
|
||||
"src/cache.js",
|
||||
"src/del.js",
|
||||
"src/utils.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
"node": "^10.12.0 || >=12.0.0"
|
||||
},
|
||||
"precommit": [
|
||||
"npm run verify --silent"
|
||||
|
|
@ -24,13 +24,11 @@
|
|||
"npm run verify --silent"
|
||||
],
|
||||
"scripts": {
|
||||
"beautify": "esbeautifier 'cache.js' 'utils.js' 'del.js' 'test/specs/**/*.js'",
|
||||
"beautify-check": "npm run beautify -- -k",
|
||||
"eslint": "eslinter 'cache.js' 'utils.js' 'del.js' 'specs/**/*.js'",
|
||||
"eslint": "eslint --cache --cache-location=node_modules/.cache/ ./src/**/*.js ./test/**/*.js",
|
||||
"eslint-fix": "npm run eslint -- --fix",
|
||||
"autofix": "npm run beautify && npm run eslint-fix",
|
||||
"check": "npm run beautify-check && npm run eslint",
|
||||
"verify": "npm run check && npm run test:cache",
|
||||
"autofix": "npm run eslint-fix",
|
||||
"check": "npm run eslint",
|
||||
"verify": "npm run eslint && npm run test:cache",
|
||||
"install-hooks": "prepush install && changelogx install-hook && precommit install",
|
||||
"changelog": "changelogx -f markdown -o ./changelog.md",
|
||||
"do-changelog": "npm run changelog && git add ./changelog.md && git commit -m 'DOC: Generate changelog' --no-verify",
|
||||
|
|
@ -65,23 +63,22 @@
|
|||
"projectName": "flat-cache"
|
||||
},
|
||||
"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"
|
||||
"chai": "^4.2.0",
|
||||
"changelogx": "^5.0.6",
|
||||
"eslint": "^7.13.0",
|
||||
"eslint-config-prettier": "^6.15.0",
|
||||
"eslint-plugin-mocha": "^8.0.0",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"glob-expand": "^0.2.1",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^8.2.1",
|
||||
"precommit": "^1.2.2",
|
||||
"prepush": "^3.1.11",
|
||||
"prettier": "^2.1.2",
|
||||
"watch-run": "^1.2.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"flatted": "^2.0.0",
|
||||
"rimraf": "2.6.3",
|
||||
"write": "1.0.3"
|
||||
"flatted": "^3.1.0",
|
||||
"rimraf": "^3.0.2"
|
||||
}
|
||||
}
|
||||
122
node_modules/flat-cache/cache.js → node_modules/flat-cache/src/cache.js
generated
vendored
122
node_modules/flat-cache/cache.js → node_modules/flat-cache/src/cache.js
generated
vendored
|
|
@ -1,7 +1,7 @@
|
|||
var path = require( 'path' );
|
||||
var fs = require( 'fs' );
|
||||
var utils = require( './utils' );
|
||||
var del = require( './del' );
|
||||
var path = require('path');
|
||||
var fs = require('fs');
|
||||
var utils = require('./utils');
|
||||
var del = require('./del');
|
||||
var writeJSON = utils.writeJSON;
|
||||
|
||||
var cache = {
|
||||
|
|
@ -14,15 +14,15 @@ var cache = {
|
|||
* @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 ) {
|
||||
load: function (docId, cacheDir) {
|
||||
var me = this;
|
||||
|
||||
me._visited = { };
|
||||
me._persisted = { };
|
||||
me._pathToFile = cacheDir ? path.resolve( cacheDir, docId ) : path.resolve( __dirname, './.cache/', docId );
|
||||
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, { } );
|
||||
if (fs.existsSync(me._pathToFile)) {
|
||||
me._persisted = utils.tryParse(me._pathToFile, {});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ var cache = {
|
|||
* @method loadFile
|
||||
* @param {String} pathToFile the path to the file containing the info for the cache
|
||||
*/
|
||||
loadFile: function ( pathToFile ) {
|
||||
loadFile: function (pathToFile) {
|
||||
var me = this;
|
||||
var dir = path.dirname( pathToFile );
|
||||
var fName = path.basename( pathToFile );
|
||||
var dir = path.dirname(pathToFile);
|
||||
var fName = path.basename(pathToFile);
|
||||
|
||||
me.load( fName, dir );
|
||||
me.load(fName, dir);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -49,7 +49,7 @@ var cache = {
|
|||
},
|
||||
|
||||
keys: function () {
|
||||
return Object.keys( this._persisted );
|
||||
return Object.keys(this._persisted);
|
||||
},
|
||||
/**
|
||||
* sets a key to a given value
|
||||
|
|
@ -57,18 +57,18 @@ var cache = {
|
|||
* @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;
|
||||
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
|
||||
removeKey: function (key) {
|
||||
delete this._visited[key]; // esfmt-ignore-line
|
||||
delete this._persisted[key]; // esfmt-ignore-line
|
||||
},
|
||||
/**
|
||||
* Return the value of the provided key
|
||||
|
|
@ -76,9 +76,9 @@ var cache = {
|
|||
* @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 ];
|
||||
getKey: function (key) {
|
||||
this._visited[key] = true;
|
||||
return this._persisted[key];
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -89,20 +89,20 @@ var cache = {
|
|||
*/
|
||||
_prune: function () {
|
||||
var me = this;
|
||||
var obj = { };
|
||||
var obj = {};
|
||||
|
||||
var keys = Object.keys( me._visited );
|
||||
var keys = Object.keys(me._visited);
|
||||
|
||||
// no keys visited for either get or set value
|
||||
if ( keys.length === 0 ) {
|
||||
if (keys.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
keys.forEach( function ( key ) {
|
||||
obj[ key ] = me._persisted[ key ];
|
||||
} );
|
||||
keys.forEach(function (key) {
|
||||
obj[key] = me._persisted[key];
|
||||
});
|
||||
|
||||
me._visited = { };
|
||||
me._visited = {};
|
||||
me._persisted = obj;
|
||||
},
|
||||
|
||||
|
|
@ -112,11 +112,11 @@ var cache = {
|
|||
* @param [noPrune=false] {Boolean} whether to remove from cache the non visited files
|
||||
* @method save
|
||||
*/
|
||||
save: function ( noPrune ) {
|
||||
save: function (noPrune) {
|
||||
var me = this;
|
||||
|
||||
(!noPrune) && me._prune();
|
||||
writeJSON( me._pathToFile, me._persisted );
|
||||
!noPrune && me._prune();
|
||||
writeJSON(me._pathToFile, me._persisted);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -125,7 +125,7 @@ var cache = {
|
|||
* @return {Boolean} true or false if the file was successfully deleted
|
||||
*/
|
||||
removeCacheFile: function () {
|
||||
return del( this._pathToFile );
|
||||
return del(this._pathToFile);
|
||||
},
|
||||
/**
|
||||
* Destroy the file cache and cache content.
|
||||
|
|
@ -133,11 +133,11 @@ var cache = {
|
|||
*/
|
||||
destroy: function () {
|
||||
var me = this;
|
||||
me._visited = { };
|
||||
me._persisted = { };
|
||||
me._visited = {};
|
||||
me._persisted = {};
|
||||
|
||||
me.removeCacheFile();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
|
@ -149,28 +149,28 @@ module.exports = {
|
|||
* @param [cacheDir] {String} directory for the cache entry
|
||||
* @returns {cache} cache instance
|
||||
*/
|
||||
load: function ( docId, cacheDir ) {
|
||||
return this.create( docId, cacheDir );
|
||||
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 );
|
||||
* 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 );
|
||||
createFromFile: function (filePath) {
|
||||
var obj = Object.create(cache);
|
||||
obj.loadFile(filePath);
|
||||
return obj;
|
||||
},
|
||||
/**
|
||||
|
|
@ -181,17 +181,17 @@ module.exports = {
|
|||
* @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 );
|
||||
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 );
|
||||
}
|
||||
clearAll: function (cacheDir) {
|
||||
var filePath = cacheDir ? path.resolve(cacheDir) : path.resolve(__dirname, '../.cache/');
|
||||
return del(filePath);
|
||||
},
|
||||
};
|
||||
13
node_modules/flat-cache/src/del.js
generated
vendored
Normal file
13
node_modules/flat-cache/src/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;
|
||||
};
|
||||
44
node_modules/flat-cache/src/utils.js
generated
vendored
Normal file
44
node_modules/flat-cache/src/utils.js
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
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) {
|
||||
fs.mkdirSync(path.dirname(filePath), {
|
||||
recursive: true,
|
||||
});
|
||||
fs.writeFileSync(filePath, flatted.stringify(data));
|
||||
},
|
||||
};
|
||||
39
node_modules/flat-cache/utils.js
generated
vendored
39
node_modules/flat-cache/utils.js
generated
vendored
|
|
@ -1,39 +0,0 @@
|
|||
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 ) );
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue