Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

incache

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

incache - npm Package Compare versions

Comparing version 7.0.4 to 7.0.5

3

CHANGELOG.md

@@ -7,2 +7,5 @@ # Change Log

## [7.0.5] - 2018-03-06
- **Improved** `all` method, now can return also a plain object
## [7.0.4] - 2018-02-28

@@ -9,0 +12,0 @@ - **Improved** `save` method, now create the full path if not exists

2

package.json
{
"name": "incache",
"version": "7.0.4",
"version": "7.0.5",
"description": "Powerful key/value in-memory storage or on disk to persist some data",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -351,47 +351,47 @@ const helper = require('./helper');

//if (helper.isServer()) {
if (opts.autoLoad)
this.load().then().catch((e) => {
});
if (opts.autoLoad)
this.load().then().catch((e) => {
});
/* istanbul ignore else */
if (opts.autoSave || opts.save) {
/* istanbul ignore else */
if (opts.autoSave || opts.save) {
if (opts.autoSaveMode === SAVE_MODE.TERMINATE && helper.isServer()) {
let self = this;
/* istanbul ignore else */
if (opts.autoSaveMode === SAVE_MODE.TERMINATE && helper.isServer()) {
let self = this;
// Wrap function
function pWrite() {
self.save().then().catch((e) => {
});
}
// Wrap function
function pWrite() {
self.save().then().catch((e) => {
});
}
// Remove if event already exists
process.removeListener('exit', pWrite);
process.removeListener('SIGINT', pWrite);
// Remove if event already exists
process.removeListener('exit', pWrite);
process.removeListener('SIGINT', pWrite);
//process.stdin.resume();
process.on('exit', pWrite);
process.on('SIGINT', pWrite);
//process.stdin.resume();
process.on('exit', pWrite);
process.on('SIGINT', pWrite);
} else if (opts.autoSaveMode === SAVE_MODE.TIMER) {
/* istanbul ignore else */
if (this._timerSaveCheck) {
clearInterval(this._timerSaveCheck);
this._timerSaveCheck = null;
}
} else if (opts.autoSaveMode === SAVE_MODE.TIMER) {
/* istanbul ignore else */
if (this._timerSaveCheck) {
clearInterval(this._timerSaveCheck);
this._timerSaveCheck = null;
}
/* istanbul ignore else */
if (opts.autoSavePeriod) {
this._timerSaveCheck = setInterval(() => {
if (this._lastChange !== this._lastChangeDetected) {
this._lastChangeDetected = this._lastChange;
this.save().then().catch(e => {
});
}
}, opts.autoSavePeriod * 1000);
}
/* istanbul ignore else */
if (opts.autoSavePeriod) {
this._timerSaveCheck = setInterval(() => {
if (this._lastChange !== this._lastChangeDetected) {
this._lastChangeDetected = this._lastChange;
this.save().then().catch(e => {
});
}
}, opts.autoSavePeriod * 1000);
}
}
}
}
//}

@@ -834,6 +834,7 @@

* Fetch all records
* @returns {Array}
* @param asObject
* @returns {*}
*/
all() {
let records = [];
all(asObject = false) {
let records = asObject ? {} : [];

@@ -845,6 +846,10 @@ for (let key in this._memory.data) {

} else {
records.push({
key: key,
value: this._memory.data[key].value
});
if (Array.isArray(records)) {
records.push({
key: key,
value: this._memory.data[key].value
});
} else {
records[key] = this._memory.data[key].value;
}
}

@@ -851,0 +856,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc