Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@harvest-profit/units

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harvest-profit/units - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

21

dist/UnitsHelper.js

@@ -95,7 +95,24 @@ "use strict";

var acresRatio = 1;
var itemAppliedAcres = parseFloat(item.applied_acres);
if (item.split) {
acresRatio = parseFloat(item.applied_acres || 0) / acres;
function isSplit() {
if (item.applied_acres_units === 'percent') return false;
if (Number.isNaN(itemAppliedAcres)) return false;
if (itemAppliedAcres === acres) return false;
return true;
}
function isRatio() {
if (item.applied_acres_units !== 'percent') return false;
if (Number.isNaN(itemAppliedAcres)) return false;
if (itemAppliedAcres === 100) return false;
return true;
}
if (isSplit()) {
acresRatio = itemAppliedAcres / acres;
} else if (isRatio()) {
acresRatio = itemAppliedAcres / 100;
}
if (item.is_total) {

@@ -102,0 +119,0 @@ var total = item.amount * perUnitCost;

2

package.json
{
"name": "@harvest-profit/units",
"version": "1.4.2",
"version": "1.4.3",
"description": "Units helper for Harvest Profit javascript applications",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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