You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

loopback-connector-mongodb

Package Overview
Dependencies
Maintainers
8
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-connector-mongodb - npm Package Compare versions

Comparing version

to
5.2.2

12

CHANGES.md

@@ -0,1 +1,13 @@

2020-02-10, Version 5.2.2
=========================
* chore: update copyright year (Diana Lau)
* chore: update CODEOWNERS (Diana Lau)
* coerce property value defined as array of ObjectID (=)
* fix: update the error message and name (#561) (Janny)
2019-11-22, Version 5.2.1

@@ -2,0 +14,0 @@ =========================

6

deps/juggler-v3/test.js
// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: loopback-connector-postgresql
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
// Node module: loopback-connector-mongodb
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

@@ -6,0 +6,0 @@ 'use strict';

// Copyright IBM Corp. 2019. All Rights Reserved.
// Node module: loopback-connector-postgresql
// This file is licensed under the Artistic License 2.0.
// License text available at https://opensource.org/licenses/Artistic-2.0
// Node module: loopback-connector-mongodb
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

@@ -6,0 +6,0 @@ 'use strict';

@@ -1,2 +0,2 @@

// Copyright IBM Corp. 2012,2019. All Rights Reserved.
// Copyright IBM Corp. 2012,2020. All Rights Reserved.
// Node module: loopback-connector-mongodb

@@ -2133,3 +2133,12 @@ // This file is licensed under the MIT License.

} else if (typeIsObjectId(dataType)) {
if (isObjectIDProperty(modelCtor, propDef, propValue)) {
if (Array.isArray(propValue)) {
propValue = propValue.map(val => {
if (isObjectIDProperty(modelCtor, propDef, val)) {
return coercedValue = ObjectID(propValue);
} else {
throw new Error(`${val} is not an ObjectID string`);
}
});
return setValue(coercedValue);
} else if (isObjectIDProperty(modelCtor, propDef, propValue)) {
coercedValue = ObjectID(propValue);

@@ -2144,3 +2153,7 @@ return setValue(coercedValue);

// Object ID coercibility depends on multiple factors, let coerceToObjectId() handle it
propValue = coerceToObjectId(modelCtor, propDef, propValue);
if (Array.isArray(propValue)) {
propValue = propValue.map(val => coerceToObjectId(modelCtor, propDef, val));
} else {
propValue = coerceToObjectId(modelCtor, propDef, propValue);
}
setValue(propValue);

@@ -2147,0 +2160,0 @@ }

{
"name": "loopback-connector-mongodb",
"version": "5.2.1",
"version": "5.2.2",
"description": "The official MongoDB connector for the LoopBack framework.",

@@ -5,0 +5,0 @@ "engines": {

Sorry, the diff of this file is not supported yet