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

moltyjs

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

moltyjs - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

8

CHANGELOG.md

@@ -35,2 +35,9 @@ ## [Unreleased]

## [0.4.2] - 2017-12-27
### Fixed
* Documentation about static methods, parameters 'connection' and 'tenant' were missing.
* Order of Schema fields validate function.
## [0.4.1] - 2017-12-27

@@ -235,2 +242,3 @@

[0.4.2]: https://github.com/Yonirt/moltyjs/compare/v0.4.1...v0.4.2
[0.4.1]: https://github.com/Yonirt/moltyjs/compare/v0.4.0...v0.4.1

@@ -237,0 +245,0 @@ [0.4.0]: https://github.com/Yonirt/moltyjs/compare/v0.3.0...v0.4.0

2

lib/model.js

@@ -243,3 +243,3 @@ 'use strict';

// Custom validation
if (typeof schema[key].validate === 'function' && !schema[key].validate(payload[key], tenant, mongoClient)) {
if (typeof schema[key].validate === 'function' && !schema[key].validate(mongoClient, tenant, payload[key])) {
throw new Error('Value assigned to ' + key + ' failed custom validator. Value was ' + payload[key]);

@@ -246,0 +246,0 @@ }

{
"name": "moltyjs",
"version": "0.4.1",
"version": "0.4.2",
"description": "A tiny ODM for MongoDB with multy tenancy support.",

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

@@ -122,3 +122,3 @@ [![npm version](https://badge.fury.io/js/moltyjs.svg)](https://badge.fury.io/js/moltyjs)

type: String,
validate: async (value, tenant, connection) => {
validate: async (connection, tenant, value) => {
const exists = await connection.find(tenant, 'TestModel', {

@@ -150,3 +150,7 @@ job: value,

```javascript
newSchema.methods.comparePassword = async function(candidatePassword) {
newSchema.methods.comparePassword = async function(
connection,
tenant,
candidatePassword,
) {
const user = this._data;

@@ -153,0 +157,0 @@ return candidatePassword === user.password;

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