Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contrail/aggregates

Package Overview
Dependencies
Maintainers
6
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrail/aggregates - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

24

lib/aggregate-helper.js

@@ -6,2 +6,5 @@ "use strict";

static getTotal(data, index) {
if (!(data === null || data === void 0 ? void 0 : data.length)) {
return;
}
let total = data.reduce(function (a, b) {

@@ -16,2 +19,5 @@ if (b[index]) {

static getAverage(data, index) {
if (!(data === null || data === void 0 ? void 0 : data.length)) {
return;
}
const withVal = data.filter(obj => (obj[index] !== undefined && obj[index] > 0));

@@ -26,6 +32,20 @@ const total = this.getTotal(data, index);

static getMin(data, index) {
return Math.min(...data.map(obj => obj[index] ? obj[index] : 0));
if (!(data === null || data === void 0 ? void 0 : data.length)) {
return;
}
let val = Math.min(...data.map(obj => obj[index] ? obj[index] : 0));
if (val === Infinity) {
return null;
}
return val;
}
static getMax(data, index) {
return Math.max(...data.map(obj => obj[index] ? obj[index] : 0));
if (!(data === null || data === void 0 ? void 0 : data.length)) {
return;
}
let val = Math.max(...data.map(obj => obj[index] ? obj[index] : 0));
if (val === Infinity) {
return null;
}
return val;
}

@@ -32,0 +52,0 @@ static getUniqueCount(data, index) {

2

package.json
{
"name": "@contrail/aggregates",
"version": "1.0.3",
"version": "1.0.4",
"description": "Utilities for computing aggregates",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc