
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
jkg-array-column-sum
Advanced tools
`getColumnSum` is an npm package for calculating the total sum of a column of numbers in an array of arrays, where each inner array represents a row of data. The package exports a single function `getColumnSum` that takes in four arguments:
getColumnSum
is an npm package for calculating the total sum of a column of numbers in an array of arrays, where each inner array represents a row of data. The package exports a single function getColumnSum
that takes in four arguments:
lists
: an array of arrays representing the dataindex
: an array of strings representing the column headersisTypeArray
(optional, default: true
): a boolean indicating whether the result should be an array of strings or a single integerdecimalNumber
(optional, default: 2
): the number of decimal places to round the result toImport the "getColumnSum" function into your component or service by adding the following code:
import getColumnSum from 'jkg-array-column-sum';
Angular - Stackblitz DEMO
Node JS - Stackblitz DEMO
React Js - Stackblitz DEMO
Call the "getColumnSum" function with a array, column names like ['column-name-1','column-name-2',...] & format type: to get total value, like this:
var data = [
['id','date','Amount'],
['1','111','123'],
['2','121','13']
];
var result = getColumnSum(data,[],false)
// By default it will consider defined columns 'Amount','Additions','Subtractions'
// Output > 136
var result = getColumnSum(data,['Amount'],false)
// Output > 136
var result = getColumnSum(data,['Amount'],true)
// Output > Array ["", "", "Total: 136.00"]
var result = getColumnSum(data, ['date', 'Amount'], true);
// Output > Array ["", "Total: 232.00", "Total: 136.00"]
var result = getColumnSum(data,['Amounts'],false)
// Output > 0
var result = getColumnSum(data,['Amounts'],true)
// Output > Array []
This package is licensed under the MIT License.
FAQs
`getColumnSum` is an npm package for calculating the total sum of a column of numbers in an array of arrays, where each inner array represents a row of data. The package exports a single function `getColumnSum` that takes in four arguments:
We found that jkg-array-column-sum 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.