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

@iobroker/db-states-file

Package Overview
Dependencies
Maintainers
6
Versions
431
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iobroker/db-states-file - npm Package Compare versions

Comparing version 5.0.20-alpha.0-20240323-74044f09 to 5.0.20-alpha.0-20240326-1f96ea5e

1

build/cjs/lib/states/statesInMemFileDB.d.ts

@@ -8,2 +8,3 @@ export = StatesInMemoryFileDB;

constructor(settings: any);
META_ID: string;
logs: {};

@@ -10,0 +11,0 @@ session: {};

9

build/cjs/lib/states/statesInMemFileDB.js

@@ -13,2 +13,3 @@ "use strict";

super(settings);
this.META_ID = "**META**";
this.logs = {};

@@ -83,6 +84,6 @@ this.session = {};

_ensureMetaDict() {
let meta = this.dataset["**META**"];
let meta = this.dataset[this.META_ID];
if (!meta) {
meta = {};
this.dataset["**META**"] = meta;
this.dataset[this.META_ID] = meta;
}

@@ -98,3 +99,3 @@ return meta;

meta[id] = value;
this.dataset["**META**"] = meta;
this.dataset[this.META_ID] = meta;
setImmediate(() => {

@@ -151,3 +152,3 @@ this.log.silly(`${this.namespace} memory publish meta ${id} ${value}`);

const r = new RegExp(tools.pattern2RegEx(pattern));
return Object.keys(this.dataset).filter((id) => r.test(id));
return Object.keys(this.dataset).filter((id) => r.test(id) && id !== this.META_ID);
}

@@ -154,0 +155,0 @@ _subscribeForClient(client, pattern) {

@@ -8,2 +8,3 @@ export = StatesInMemoryFileDB;

constructor(settings: any);
META_ID: string;
logs: {};

@@ -10,0 +11,0 @@ session: {};

@@ -49,13 +49,14 @@ /**

super(settings);
this.META_ID = '**META**';
this.logs = {};
this.session = {};
this.globalMessageId = Math.round(Math.random() * 100000000);
this.globalLogId = Math.round(Math.random() * 100000000);
this.globalMessageId = Math.round(Math.random() * 100_000_000);
this.globalLogId = Math.round(Math.random() * 100_000_000);
this.stateExpires = {};
this.sessionExpires = {};
this.ONE_DAY_IN_SECS = 24 * 60 * 60 * 1000;
this.ONE_DAY_IN_SECS = 24 * 60 * 60 * 1_000;
this.writeFileInterval =
this.settings.connection && typeof this.settings.connection.writeFileInterval === 'number'
? parseInt(this.settings.connection.writeFileInterval)
: 30000;
: 30_000;
if (settings.jsonlDB) {

@@ -132,6 +133,6 @@ this.log.silly(`${this.namespace} States DB uses file write interval of ${this.writeFileInterval} ms`);

_ensureMetaDict() {
let meta = this.dataset['**META**'];
let meta = this.dataset[this.META_ID];
if (!meta) {
meta = {};
this.dataset['**META**'] = meta;
this.dataset[this.META_ID] = meta;
}

@@ -160,3 +161,3 @@ return meta;

// Make sure the object gets re-written, especially when using an external DB
this.dataset['**META**'] = meta;
this.dataset[this.META_ID] = meta;
setImmediate(() => {

@@ -222,3 +223,3 @@ // publish event in states

const r = new RegExp(tools.pattern2RegEx(pattern));
return Object.keys(this.dataset).filter(id => r.test(id));
return Object.keys(this.dataset).filter(id => r.test(id) && id !== this.META_ID);
}

@@ -225,0 +226,0 @@ // needed by Server

{
"name": "@iobroker/db-states-file",
"version": "5.0.20-alpha.0-20240323-74044f09",
"version": "5.0.20-alpha.0-20240326-1f96ea5e",
"engines": {

@@ -8,4 +8,4 @@ "node": ">=12.0.0"

"dependencies": {
"@iobroker/db-base": "5.0.20-alpha.0-20240323-74044f09",
"@iobroker/db-states-redis": "5.0.20-alpha.0-20240323-74044f09"
"@iobroker/db-base": "5.0.20-alpha.0-20240326-1f96ea5e",
"@iobroker/db-states-redis": "5.0.20-alpha.0-20240326-1f96ea5e"
},

@@ -48,3 +48,3 @@ "keywords": [

],
"gitHead": "487be77dd42776c1fb2635c309c0d7c64dcefe57"
"gitHead": "b043ba922df87f3b0f03340c01c03a2a48e9f16b"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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