Socket
Socket
Sign inDemoInstall

summary

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 0.3.1

4

package.json
{
"name": "summary",
"description": "Takes an array of numbers and calculates some descriptive statistics",
"version": "0.3.0",
"version": "0.3.1",
"author": "Andreas Madsen <amwebdk@gmail.com>",

@@ -33,2 +33,2 @@ "main": "./summary.js",

}
}
}
var array_types = [
Array, Int8Array, Uint8Array, Int16Array, Uint16Array,
Int32Array, Uint32Array, Float32Array, Float64Array
];
function Summary(data, sorted) {
if (!(this instanceof Summary)) return new Summary(data, sorted);
if (!Array.isArray(data)) {
if (array_types.indexOf(data.constructor) === -1) {
throw TypeError('data must be an array');

@@ -7,0 +12,0 @@ }

@@ -125,1 +125,7 @@

});
test('typed array', function (t) {
t.equal(summary(new Int8Array([2, 4])).mean(), 3);
t.end();
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc