Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
immutable-lib
Advanced tools
A JavaScript Library for immutable array helpers
import { copy } from "immutable-lib";
const a = [1, 2, 3];
const b = copy(a);
console.log(b); // [1, 2, 3]
Copies an array to a new variable.
import { copy } from "immutable-lib";
const a = [1, 2, 3];
const b = copy(a);
console.log(b); // [1, 2, 3]
Creates a new array minus given array item.
import { del } from "immutable-lib";
const a = [1, 2, 3];
const b = del(a, 1);
console.log(b); // [1, 3]
Removes the last item from the array.
import { del } from "immutable-lib";
const a = [1, 2, 3];
const b = pop(a);
console.log(b); // [1, 2]
Adds a new item at the end of an array.
import { push } from "immutable-lib";
const a = [1, 2, 3];
const b = push(a, 4);
console.log(b); // [1, 2, 3, 4]
Reverses the order of an array.
import { reverse } from "immutable-lib";
const a = [1, 2, 3];
const b = reverse(a);
console.log(b); // [3, 2, 1]
Removes an item from the beginning of an array.
import { shift } from "immutable-lib";
const a = [1, 2, 3];
const b = shift(a);
console.log(b); // [2, 3]
Sorts an array.
import { sort } from "immutable-lib";
const a = [1, 2, 3];
const b = sort(a, (x, y) => y - x);
console.log(b); // [3, 2, 1]
Modifies the contents of an array.
import { splice } from "immutable-lib";
const a = [1, 2, 3];
const b = splice(a, 2, 2, [7, 8]);
console.log(b); // [1, 2, [7, 8], 5, 6]
Adds an item from the beginning of an array.
import { sort } from "immutable-lib";
const a = [1, 2, 3];
const b = unshift(a, 4);
console.log(b); // [4, 1, 2, 3]
FAQs
Immutable helpers for arrays
We found that immutable-lib 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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.