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

medici

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

medici - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

30

lib/book.js

@@ -43,9 +43,5 @@ // Generated by CoffeeScript 1.6.3

}
if (query.start_date && query.end_date && query.start_date.length && query.end_date.length) {
start_date = new Date(Date.UTC(parseInt(query.start_date)));
end_date = new Date(Date.UTC(parseInt(query.end_date)));
end_date.setUTCHours(23);
end_date.setMinutes(59);
end_date.setSeconds(59);
console.log('end date:', end_date);
if ((query.start_date != null) && (query.end_date != null)) {
start_date = new Date(parseInt(query.start_date));
end_date = new Date(parseInt(query.end_date));
parsed['datetime'] = {

@@ -57,13 +53,8 @@ $gte: start_date,

delete query.end_date;
} else if (query.start_date && query.start_date.length) {
} else if (query.start_date != null) {
parsed['datetime'] = {
$gte: new Date(Date.UTC(parseInt(query.start_date)))
$gte: new Date(parseInt(query.start_date))
};
delete query.start_date;
} else if (query.end_date && query.end_date.length) {
end_date = new Date(Date.UTC(parseInt(query.end_date)));
end_date.setHours(23);
end_date.setMinutes(59);
end_date.setSeconds(59);
console.log('end date:', end_date);
} else if (query.end_date != null) {
parsed['datetime'] = {

@@ -75,8 +66,4 @@ $lte: new Date(parseInt(query.end_date))

keys = _.keys(mongoose.model('Medici_Transaction').schema.paths);
console.log('keys:', keys);
for (key in query) {
val = query[key];
if (!val) {
continue;
}
if (keys.indexOf(key) >= 0) {

@@ -99,3 +86,2 @@ /*if key.substr(0, 1) is '_'

parsed.book = this.name;
console.log('parsed query to:', parsed);
return parsed;

@@ -108,3 +94,2 @@ };

query = this.parseQuery(query);
console.log('balance query:', query);
match = {

@@ -124,3 +109,2 @@ $match: query

};
console.log('query:', match, group);
mongoose.model('Medici_Transaction').aggregate(match, group, function(err, result) {

@@ -133,3 +117,3 @@ var total;

total = result.credit - result.debit;
total = Math.round(total * 100) / 100;
console.log('got total:', total);
return deferred.resolve(total);

@@ -136,0 +120,0 @@ }

{
"name": "medici",
"version": "0.5.0",
"version": "0.6.0",
"description": "Simple double-entry accounting for Node + Mongoose",

@@ -5,0 +5,0 @@ "main": "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