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.12 to 1.1.0

39

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

@@ -13,2 +12,3 @@ function hashObject (obj) {

module.exports = {
hash: hashObject,
spawn (query, prop) {

@@ -19,40 +19,3 @@ const ds = this

return ds.record.observe(`${hash}:agent${prop ? `.${prop}` : ``}`)
},
provide (type, fn) {
const ds = this
return ds.record.provide(`^.+:agent-${type}$`, key => ds.record
.observe(`${key}.query`)
.first(x => Object.keys(x).length > 0)
.switchMap(query => fn(key, query))
)
},
init () {
const ds = this
return ds.record.provide(`^(.+):agent(?:\\.(methods|stats|result|description))?$`, key => {
const [ , id, prop ] = key.match(/^(.+):agent(?:\.(methods|stats|result|description))?$/)
return ds.record
.observe(`${id}:agent.query`)
.first(x => Object.keys(x).length > 0)
.switchMap(({ type, parent, description }) => {
if (!prop) {
return Observable.of({ type, parent })
}
if (prop === 'description') {
return Observable.of(description)
}
const name = `${hashObject(description)}:agent-${type}`
ds.record.set(`${name}.query`, { parent, description })
return ds.record
.observe(name)
.pluck(prop)
.map(x => x || {})
})
.catch(err => Observable.of({ error: err.message || err }))
})
}
}

5

package.json
{
"name": "@nxtedition/agent",
"version": "1.0.12",
"version": "1.1.0",
"main": "index.js",
"author": "Robert Nagy <robert.nagy@boffins.se>",
"dependencies": {
"object-hash": "^1.1.8",
"rxjs": "^5.4.2"
"object-hash": "^1.1.8"
}
}
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