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.7 to 1.0.8

42

index.js
const objectHash = require('object-hash')
const { Observable } = require('rxjs')

@@ -12,48 +11,7 @@ function hashObject (obj) {

const providers = new Map()
setInterval(() => {
for (const [ key, provider ] of providers) {
if (provider.refs === 0) {
provider.unsubscribe()
providers.delete(key)
}
}
}, 60000)
module.exports = {
observe (query, prop) {
const ds = this
const hash = hashObject(query)
return Observable
.using(
() => {
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}` : ``}`)
)
},
spawn (query, prop) {
const ds = this
const hash = hashObject(query)
ds.record.set(`${hash}:agent.query`, query)
return ds.record.observe(`${hash}:agent${prop ? `.${prop}` : ``}`)

@@ -60,0 +18,0 @@ },

2

package.json
{
"name": "@nxtedition/agent",
"version": "1.0.7",
"version": "1.0.8",
"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