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

mongolass

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongolass - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

6

changelog.md

@@ -0,1 +1,7 @@

## 2.3.0/2016-10-11
- model function cannot be modified now
- add model function name
- upgrade error stack
## 2.2.0/2016-10-04

@@ -2,0 +8,0 @@

28

lib/query.js

@@ -40,2 +40,4 @@ 'use strict';

constructor(op, args) {
Error.captureStackTrace(this, this.constructor);// preserve stack
this._op = op;

@@ -95,13 +97,19 @@ this._args = args;

function _bindMethod(propName) {
ctx[propName] = (...args) => {
if (args.length && ('function' === typeof args[args.length - 1])) {
throw new TypeError('Not support callback for method: ' + propName + ', please call .exec() or .cursor()');
}
if (['find', 'findOne'].indexOf(propName) !== -1) {
if (args.length > 2) {
throw new TypeError('Only support this usage: ' + propName + '(query, options)');
Object.defineProperty(ctx, propName, {
enumerable: true,
value: (...args) => {
if (args.length && ('function' === typeof args[args.length - 1])) {
throw new TypeError('Not support callback for method: ' + propName + ', please call .exec() or .cursor()');
}
if (['find', 'findOne'].indexOf(propName) !== -1) {
if (args.length > 2) {
throw new TypeError('Only support this usage: ' + propName + '(query, options)');
}
}
return new Query(propName, args);
}
return new Query(propName, args);
};
});
Object.defineProperty(ctx[propName], 'name', {
value: propName
});
}

@@ -185,2 +193,4 @@

function addMongoErrorDetail(e) {
// overwrite error stack
e.stack = this.stack;
//only for mongoError

@@ -187,0 +197,0 @@ if (!e.model) {

{
"name": "mongolass",
"version": "2.2.0",
"version": "2.3.0",
"description": "Elegant MongoDB driver for Node.js.",

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

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