Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
npm install arrobj
bower install arrobj
// vanilla javascript
const arrobj = require("arrobj");
// es6 syntax
import * as arrobj from "arrobj";
<script src="path/to/arrobj.js"></script>
Below code:
var values = ['bliss', 21, ['soccer', 'basketball']];
var key = ['name', 'age', 'sports'];
console.log(arrobj.toObj(values, key));
Will create object:
{
name: 'bliss',
age: 21,
sports: ['soccer', 'basketball']
}
If the key array is shorter than the values array, the index of the values in the array will used instead. The produced array for the above use case will be:
{
0: 'bliss',
1: 21,
2: ['soccer', 'basketball']
}
To convert an object to an array, the below case:
var obj = {
name: 'bliss',
age: 21,
sports: ['soccer', 'basketball']
};
console.log(arr.toArr(obj));
Will produce array:
['bliss', 21, ['soccer', 'basketball']]
isFlat(array): Checks if an array has a nested array.
isEqual(array1, array2): Compares two arrays by length.
isSame(array1, array2): Checks if the values in the array are the same, works for deep level comparison.
Arr(array): Checks if an argument is an array.
FAQs
Array and Object handling
We found that arrobj 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.