New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

calc-stats

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calc-stats - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

14

calc-stats.js

@@ -52,3 +52,3 @@ const { getOrCreateIterator } = require("iter-fun");

index++;
if (value !== noData && filter({ count, index, value }) === true) {
if (typeof value === "number" && value !== noData && filter({ count, index, value }) === true) {
process(value);

@@ -58,7 +58,7 @@ }

} else if (typeof noData === "number") {
step = value => value !== noData && process(value);
step = value => typeof value === "number" && value !== noData && process(value);
} else if (typeof filter === "function") {
step = value => {
index++;
if (filter({ count, index, value }) === true) {
if (typeof value === "number" && filter({ count, index, value }) === true) {
process(value);

@@ -68,3 +68,3 @@ }

} else {
step = process;
step = value => typeof value === "number" && process(value);
}

@@ -74,4 +74,3 @@

const results = {};
if (calcMedian)
results.median = fasterMedian({ counts: histogram, total: count });
if (calcMedian) results.median = fasterMedian({ counts: histogram, total: count });
if (calcMin) results.min = min;

@@ -99,4 +98,3 @@ if (calcMax) results.max = max;

// compute mean value of all the most popular numbers
if (calcMode)
results.mode = modes.reduce((acc, n) => acc + n, 0) / modes.length;
if (calcMode) results.mode = modes.reduce((acc, n) => acc + n, 0) / modes.length;
}

@@ -103,0 +101,0 @@

{
"name": "calc-stats",
"version": "0.4.0",
"version": "0.4.1",
"description": "Memory-Aware Statistical Calculations",

@@ -10,3 +10,3 @@ "main": "calc-stats.js",

"scripts": {
"format": "npx prettier --arrow-parens=avoid --trailing-comma=none --write *.js",
"format": "npx prettier --arrow-parens=avoid --print-width=120 --trailing-comma=none --write *.js",
"test": "node test.js"

@@ -13,0 +13,0 @@ },

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