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

@daeinc/array

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@daeinc/array - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

5

dist/index.d.ts
/**
* accumulate array values. ex. [50,50,50] => [50,100,150]
*
* TEST: float rounding error needs more testing
*
* @param arr
* @returns
*/
export declare const accumulate: (arr: number[]) => number[];
export declare const accumulate: (arr: number[], precision?: number) => number[];
/**

@@ -8,0 +11,0 @@ * add to array in-place while limiting how many to keep history.

8

dist/index.js

@@ -7,10 +7,14 @@ "use strict";

* accumulate array values. ex. [50,50,50] => [50,100,150]
*
* TEST: float rounding error needs more testing
*
* @param arr
* @returns
*/
const accumulate = (arr) => {
const accumulate = (arr, precision = 4) => {
const result = [];
let sum = 0;
for (let i = 0; i < arr.length; i++) {
sum += arr[i];
sum = sum + (0, math_1.roundF)(arr[i], 4);
sum = (0, math_1.roundF)(sum, 4);
result.push(sum);

@@ -17,0 +21,0 @@ }

{
"name": "@daeinc/array",
"version": "0.3.0",
"version": "0.3.1",
"description": "Array utilities",

@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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