New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 4.0.0 to 4.1.0

7

changelog.md

@@ -1,3 +0,8 @@

## 4.0.0/2018-01-03
## 4.1.0/2018-01-09
- upgrade another-json-schema@3.4.0
- update operators will not check `default` & `required`
## 4.0.0/2018-01-08
- [feat] use eslint@standard

@@ -4,0 +9,0 @@ - [feat] upgrade another-json-schema@3

@@ -238,3 +238,5 @@ const _ = require('lodash')

additionalProperties: true,
ignoreNodeType: true
ignoreNodeType: true,
required: false,
default: false
})

@@ -262,2 +264,7 @@ // try format, if false then pass

function _formatUpdate (doc, schemaPath = '', parentDoc, parentKey, opts = {}) {
// update operators will not check `default` & `required`
_.defaults(opts, {
required: false,
default: false
})
if (_.isPlainObject(doc)) {

@@ -355,3 +362,7 @@ for (let key in doc) {

let key = parentKey.split('.').slice(-1)[0]
const result = schema._parent.validate({ [key]: doc }, { ignoreNodeType: true })
const result = schema._parent.validate({ [key]: doc }, {
ignoreNodeType: true,
required: false,
default: false
})
if (!result.valid) {

@@ -358,0 +369,0 @@ throw result.error

7

package.json
{
"name": "mongolass",
"version": "4.0.0",
"version": "4.1.0",
"description": "Elegant MongoDB driver for Node.js.",
"main": "lib/index.js",
"scripts": {
"pretest": "eslint .",
"pretest": "./node_modules/.bin/eslint .",
"test": "node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha"

@@ -42,3 +42,3 @@ },

"dependencies": {
"another-json-schema": "3.3.0",
"another-json-schema": "3.4.0",
"debug": "3.1.0",

@@ -54,2 +54,3 @@ "inflected": "2.0.3",

"co-mocha": "^1.2.1",
"eslint": "4.15.0",
"eslint-config-standard": "11.0.0-beta.0",

@@ -56,0 +57,0 @@ "eslint-plugin-import": "2.8.0",

@@ -42,2 +42,17 @@ const MONGODB = process.env.MONGODB || 'mongodb://localhost:27017/test'

it('connect with auth', function * () {
const mongolass2 = new Mongolass('mongodb://admin:123456@ds247587.mlab.com:47587/mongolass')
const User = mongolass2.model('User')
const name = Date.now()
yield User.insert({ name })
const user = yield User.findOne({ name })
assert.ok(user)
assert.ok(user._id)
assert.deepEqual(user.name, name)
yield mongolass2.disconnect()
})
it('connect failed', function * () {

@@ -44,0 +59,0 @@ let error

@@ -10,3 +10,3 @@ const MONGODB = process.env.MONGODB || 'mongodb://localhost:27017/test'

const UserSchema = new Schema('User', {
name: { type: 'string' },
name: { type: 'string', required: true },
age: { type: 'number', range: [0, 100] },

@@ -124,3 +124,3 @@ refe: { type: Mongolass.Types.ObjectId },

actual: 1,
expected: { type: 'string' },
expected: { type: 'string', required: true },
path: '$.name',

@@ -163,3 +163,3 @@ schema: 'User',

actual: 1,
expected: { type: 'string' },
expected: { type: 'string', required: true },
path: '$.name',

@@ -204,3 +204,3 @@ schema: 'User',

actual: 1,
expected: { type: 'string' },
expected: { type: 'string', required: true },
path: '$.name',

@@ -660,3 +660,3 @@ schema: 'User',

actual: 1,
expected: { type: 'string' },
expected: { type: 'string', required: true },
path: '$.name',

@@ -705,3 +705,3 @@ schema: 'User',

actual: 1,
expected: { type: 'string' },
expected: { type: 'string', required: true },
path: '$.name',

@@ -728,3 +728,3 @@ schema: 'User',

actual: 1,
expected: { type: 'string' },
expected: { type: 'string', required: true },
path: '$.name',

@@ -811,3 +811,3 @@ schema: 'User',

actual: 1,
expected: { type: 'string' },
expected: { type: 'string', required: true },
path: '$.name',

@@ -814,0 +814,0 @@ schema: 'User',

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