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.
A library for array functions in Array.prototype
npm install array-lib
const arrayLib = require("array-lib");
//deep copy a array:
let arr = [1,2,3];
let clone_arr = arr.clone();
// Print an array:
arr.print()//output [1,2,3]
//Retrun max value from array and ignores elements that are not a number:
console.log(arr.max());
//Returns index of max value in array:
console.log(arr.max_index());
//Removes element at specified position:
arr.remove(0);
arr.print()//Output: [2,3]
//Removes first or all values from array:
let a = [1,2,3,4,4,5,5];
let remove_all_elements = true;
a.remove_val(4,remove_all_elements);
a.print();//Output: [1,2,3,5,5];
//Count how much time a element is in a array
let b = ["a","b","b","c","b"];
console.log(b.count("b"));//Output: 3
//Replace elements in array
let c = [1,2,3,3,3,4,6,6,9];
c.replace(3,"d");
c.print();//output:[1,2,"d","d","d",4,6,6,9]
//Add up all numbers in array:
let d = [1,2,3,4,5];
console.log(d.add_up());//output: 15
//Create 2d array:
let arr = Array.matrix(2,3,"fill")
arr.print();
//Output:
//[
// [ 'fill', 'fill', 'fill' ],
// [ 'fill', 'fill', 'fill' ]
// ]
//Create array:
let arr = Array.vector(6,"fill");
arr.print();//Output:['fill', 'fill', 'fill','fill', 'fill', 'fill']
FAQs
A library for array functions in Array.prototype
The npm package array-lib receives a total of 66 weekly downloads. As such, array-lib popularity was classified as not popular.
We found that array-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.