Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
observ-sync-hash
Advanced tools
Synchronize an observable hash table with an array with primary keys
Synchronize an observable hash table with an array with primary keys
$ npm install --save observ-sync-hash
var sync = require('observ-sync-hash')
var ObservArray = require('observ-array')
var Hash = require('observ-varhash')
var array = ObservArray([])
var hash = Hash({})
sync(array, hash)
array.push(123)
hash()
//=> {123: null}
array.splice(0, 1)
hash()
//=> {}
sync(array, hash, [key])
-> function
Returns an unlisten
function.
Required
Type: function
Required
Type: function
Type: string
If provided, the hash keys will be derived from a property of each array item instead of the string values themselves. You can use id
or even dot syntax, e.g. foo.id
.
Type: boolean
Default: false
If true
, data from the array will be added to the hash instead of null
values.
MIT © Ben Drucker
FAQs
Synchronize an observable hash table with an array with primary keys
We found that observ-sync-hash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.