Comparing version 3.0.1 to 3.0.2
{ | ||
"name": "medici", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Simple double-entry accounting for Node + Mongoose", | ||
@@ -32,3 +32,3 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"mongoose": "^5.6.2" | ||
"mongoose": "^5.8.3" | ||
}, | ||
@@ -35,0 +35,0 @@ "homepage": "https://github.com/koresar/medici", |
@@ -7,2 +7,6 @@ [![Build Status](https://travis-ci.org/koresar/medici.png?branch=master)](https://travis-ci.org/koresar/medici) | ||
```bash | ||
npm i medici | ||
``` | ||
## Basics | ||
@@ -280,3 +284,4 @@ | ||
* the mandatory `_id` index takes about 600 KB, | ||
* each of the above mentioned indexes take from 300 to 600 KB. | ||
* each of the medici default indexes take from 300 to 600 KB. | ||
* your custom indexes containing `meta.*` properties would take 600 to 1200 KB. | ||
@@ -283,0 +288,0 @@ ## Changelog |
@@ -136,7 +136,13 @@ module.exports = class Entry { | ||
// Hello JavaScript. Your math rounding skill is mesmerising. | ||
if (total > -1e-10 && total < 1e-10) total = 0; | ||
if (total > -1e-7 && total < 1e-7) total = 0; | ||
// Medici is about money counting. It should probably use more precise floating point number structure. | ||
// However, for now we use JS built-in Number. Hence Medici limitations are coming from Number.MAX_SAFE_INTEGER === 9007199254740991 | ||
// Here are the limitations: | ||
// * You can safely add values up to 1 billion and down to 0.000001. | ||
// * Anything more than 1 billion or less than 0.000001 is not guaranteed and will throw the below error. | ||
if (total > 0 || total < 0) { | ||
const err = new Error("INVALID_JOURNAL"); | ||
if (total !== 0) { | ||
const err = new Error("INVALID_JOURNAL: can't commit non zero total"); | ||
err.code = 400; | ||
err.total = total; | ||
console.error("Journal is invalid. Total is:", total); | ||
@@ -143,0 +149,0 @@ return Promise.reject(err); |
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
29061
563
308
Updatedmongoose@^5.8.3