New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

loopback-connector-mysql

Package Overview
Dependencies
Maintainers
4
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loopback-connector-mysql - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

25

lib/mysql.js

@@ -60,2 +60,5 @@ /*!

for (var p in s) {
if (p === 'database' && s.createDatabase) {
continue;
}
if (options[p] === undefined) {

@@ -153,3 +156,3 @@ options[p] = s[p];

if (err) {
console.error('Error: ', err);
console.error('Error: %j', err);
}

@@ -239,3 +242,3 @@ debug('Data: ', data);

var v;
v = mysql.toDatabase(props[key], data[key]);
v = mysql.toDatabase(props[key], data[key], true);
if (v !== undefined) {

@@ -270,3 +273,3 @@ fieldsNames.push(k);

if (props[key]) {
var value = this.toDatabase(props[key], data[key]);
var value = this.toDatabase(props[key], data[key], true);
if (undefined === value) {

@@ -300,7 +303,7 @@ return;

*/
MySQL.prototype.toDatabase = function (prop, val) {
MySQL.prototype.toDatabase = function (prop, val, forCreate) {
if (val === null || val === undefined) {
return 'NULL';
}
if (val.constructor.name === 'Object') {
if (!forCreate && val.constructor.name === 'Object') {
var operator = Object.keys(val)[0]

@@ -350,2 +353,6 @@ val = val[operator];

if (typeof prop.type === 'function') {
if (prop.type.modelName) {
// For embedded models
return this.client.escape(JSON.stringify(val));
}
return this.client.escape(prop.type(val));

@@ -371,5 +378,9 @@ }

var val = data[key];
if (typeof val === 'undefined' || val === null) {
if (val === undefined) {
continue;
}
if (val === null) {
json[p] = null;
continue;
}
if (props[p]) {

@@ -665,3 +676,3 @@ switch (props[p].type.name) {

if (err) {
console.error(err);
console.error('%j', err);
}

@@ -668,0 +679,0 @@ if (--wait === 0 && cb) {

{
"name": "loopback-connector-mysql",
"version": "1.4.2",
"version": "1.4.3",
"description": "MySQL connector for loopback-datasource-juggler",

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