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

@nxtedition/agent

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nxtedition/agent - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

33

index.js

@@ -12,2 +12,13 @@ const objectHash = require('object-hash')

const providers = new Map()
setInterval(() => {
for (const [ key, provider ] of providers) {
if (provider.refs === 0) {
provider.unsubscribe()
providers.delete(key)
}
}
}, 60000)
module.exports = {

@@ -20,5 +31,21 @@ observe (query, prop) {

.using(
() => ({
unsubscribe: ds.record.provide(`${hash}:agent.query`, () => Observable.of(query))
}),
() => {
let provider = providers.get(hash)
if (!provider) {
provider = {
unsubscribe: ds.record.provide(`${hash}:agent.query`, () => Observable.of(query)),
refs: 0
}
providers.set(hash, provider)
}
provider.refs += 1
return {
unsubscribe: () => {
provider.refs -= 1
}
}
},
() => ds.record.observe(`${hash}:agent${prop ? `.${prop}` : ``}`)

@@ -25,0 +52,0 @@ )

2

package.json
{
"name": "@nxtedition/agent",
"version": "1.0.6",
"version": "1.0.7",
"main": "index.js",

@@ -5,0 +5,0 @@ "author": "Robert Nagy <robert.nagy@boffins.se>",

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