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.
immutable-splice
Advanced tools
Changes the contents of an array or string by removing or replacing existing elements and/or adding new elements.
Based off the Array.prototype.splice()
method—but immutable.
splice(input, start)
splice(input, start, deleteCount)
splice(input, start, deleteCount, item1, item2, ...)
input
the Array
or String
to splice.
start
Number
index at which to start changing the input
.
deleteCount
optional Number
of elements in the array to remove from start
.
If deleteCount
is omitted, then all the elements from start
to the end of the input
will be deleted.
item1, item2, ...
optional elements to add to the input
, beginning from start
.
A new Array
or String
containing the changes made.
import splice from 'immutable-splice';
splice(['foo', 'bar', 'baz'], 1, 1);
// returns ['foo', 'baz']
splice('cool', 1, 2, '0', 'O');
// returns 'c0Ol'
v1.0.1 - 2021-06-14
FAQs
Immutable splice function for arrays and strings.
We found that immutable-splice 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.