Comparing version 1.2.0 to 1.3.0
@@ -10,2 +10,3 @@ "use strict"; | ||
exports.simpleCostDifference = simpleCostDifference; | ||
exports.costDifference = costDifference; | ||
exports["default"] = void 0; | ||
@@ -65,10 +66,44 @@ | ||
// initialValue: Number | ||
// baseAaop: Number | ||
// baseAaopFraction: Number | ||
// baseCost: Number | ||
// newAaop: Number | ||
// newAaopFraction: Number | ||
// newCost: Number | ||
function simpleCostDifference(initialValue, baseAaop, baseCost, newAaop, newCost) { | ||
return initialValue * (baseAaop + baseCost - (newAaop + newCost)); | ||
function simpleCostDifference(initialValue, baseAaopFraction, baseCost, newAaopFraction, newCost) { | ||
return initialValue * (baseAaopFraction + baseCost - (newAaopFraction + newCost)); | ||
} // function savingsAfterYear | ||
// Calculates the difference in costs for a single year | ||
// | ||
// Arguments: | ||
// initialValue: Number | ||
// baseAaopFraction: Number | ||
// baseCost: Number | ||
// newAaopFraction: Number | ||
// newCost: Number | ||
// --------------- | ||
// Returns: | ||
// totalBaseCostFraction: Number | ||
// totalBaseCost: Number | ||
// totalNewCostFraction: Number | ||
// totalNewCost: Number | ||
// totalSaved: Number | ||
// totalSavedFraction: Number | ||
function costDifference(initialValue, baseAaopFraction, baseCost, newAaopFraction, newCost) { | ||
var totalBaseCostFraction = baseAaopFraction + baseCost; | ||
var totalBaseCost = initialValue * totalBaseCostFraction; | ||
var totalNewCostFraction = newAaopFraction + newCost; | ||
var totalNewCost = initialValue * totalNewCostFraction; | ||
var totalSaved = totalBaseCost - totalNewCost; | ||
var totalSavedFraction = totalBaseCostFraction - totalNewCostFraction; | ||
return { | ||
totalBaseCostFraction: totalBaseCostFraction, | ||
totalBaseCost: totalBaseCost, | ||
totalNewCostFraction: totalNewCostFraction, | ||
totalNewCost: totalNewCost, | ||
totalSaved: totalSaved, | ||
totalSavedFraction: totalSavedFraction | ||
}; | ||
} | ||
@@ -79,4 +114,6 @@ | ||
differenceAfterYearWithFirstYear: differenceAfterYearWithFirstYear, | ||
valueAtYearWithStandardDeviation: valueAtYearWithStandardDeviation | ||
valueAtYearWithStandardDeviation: valueAtYearWithStandardDeviation, | ||
simpleCostDifference: simpleCostDifference, | ||
costDifference: costDifference | ||
}; | ||
exports["default"] = _default; |
{ | ||
"name": "algostrata", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "calculation library for algostrata", | ||
@@ -11,3 +11,4 @@ "main": "build/index.js", | ||
"test": "mocha './src/**/*.test.js' --require @babel/register", | ||
"lint": "eslint ." | ||
"lint": "eslint .", | ||
"pipeline": "mocha './src/**/*.test.js' --require @babel/register && eslint . && babel src -d build" | ||
}, | ||
@@ -14,0 +15,0 @@ "author": "Algostrata", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5990
104