@rss/common
Advanced tools
Comparing version 0.0.43 to 0.0.44
@@ -78,3 +78,3 @@ 'use strict'; | ||
this.size = opt.size ? parseFloat(opt.size, 10) : null; | ||
this.amount = parseFloat(!isNaN(opt.amount) ? opt.amount : opt.size, 10); // eslint-disable-line | ||
this.amount = parseFloat(!isNaN(opt.amount) && opt.amount !== null ? opt.amount : opt.size, 10); // eslint-disable-line | ||
this.units = opt.units || null; | ||
@@ -81,0 +81,0 @@ this.physicalState = opt.physicalState || null; |
{ | ||
"name": "@rss/common", | ||
"version": "0.0.43", | ||
"version": "0.0.44", | ||
"description": "common constant, classes, & helper", | ||
@@ -5,0 +5,0 @@ "author": "Risk & Safety Solution", |
@@ -66,3 +66,3 @@ const ObjectId = require('bson').ObjectID; | ||
this.size = opt.size ? parseFloat(opt.size, 10) : null; | ||
this.amount = parseFloat(!isNaN(opt.amount) ? opt.amount : opt.size, 10); // eslint-disable-line | ||
this.amount = parseFloat(!isNaN(opt.amount) && opt.amount !== null ? opt.amount : opt.size, 10); // eslint-disable-line | ||
this.units = opt.units || null; | ||
@@ -69,0 +69,0 @@ this.physicalState = opt.physicalState || null; |
@@ -24,3 +24,3 @@ const Container = require('./container'); | ||
it('should set container amount to container size if not passed in', () => { | ||
const cont = new Container({ size: 10 }); | ||
const cont = new Container({ size: 10, amount: null }); | ||
expect(cont.amount).toEqual(10); | ||
@@ -27,0 +27,0 @@ }); |
Sorry, the diff of this file is not supported yet
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
734000