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

z-score

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

z-score - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

11

lib/zscore.js

@@ -53,6 +53,11 @@ 'use strict';

return _lodash2.default.mapValues(dataItem, function (dataValue, dataKey) {
var difference = dataValue - _this2.data[dataKey].mean;
return difference / _this2.data[dataKey].stdDev;
var zScores = _lodash2.default.mapValues(dataItem, function (dataValue, dataKey) {
if (_lodash2.default.isNumber(dataValue)) {
var difference = dataValue - _this2.data[dataKey].mean;
return difference / _this2.data[dataKey].stdDev;
}
});
return _lodash2.default.pickBy(zScores, function (zScore) {
return !_lodash2.default.isUndefined(zScore);
});
}

@@ -59,0 +64,0 @@ }]);

{
"name": "z-score",
"version": "1.0.2",
"version": "1.0.3",
"description": "",

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

@@ -31,6 +31,11 @@ import _ from 'lodash'

calculate(dataItem) {
return _.mapValues(dataItem, (dataValue, dataKey) => {
const difference = dataValue - this.data[dataKey].mean
return difference / this.data[dataKey].stdDev
const zScores = _.mapValues(dataItem, (dataValue, dataKey) => {
if(_.isNumber(dataValue)) {
const difference = dataValue - this.data[dataKey].mean
return difference / this.data[dataKey].stdDev
}
})
return _.pickBy(zScores, zScore => {
return !_.isUndefined(zScore)
})
}

@@ -37,0 +42,0 @@

@@ -59,2 +59,3 @@ import ZScore from '../src/zscore'

expect(zScore.calculate({
description: 'cloudy',
temperature: 11

@@ -61,0 +62,0 @@ })).to.deep.equal({

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