New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

hapi-plugin-mysql

Package Overview
Dependencies
Maintainers
2
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-plugin-mysql - npm Package Compare versions

Comparing version
7.2.6
to
7.2.7
.idea/hapi-plugin-mysql.iml

Sorry, the diff of this file is not supported yet

+6
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/hapi-plugin-mysql.iml" filepath="$PROJECT_DIR$/.idea/hapi-plugin-mysql.iml" />
</modules>
</component>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
+15
-15

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

request.app.connection = connection;
// Since commit/rollback/beginTransaction uses the .query it will auto promisify them
request.app.connection.query = Util.promisify(connection.query);

@@ -34,11 +32,2 @@ return h.continue;

if (!callback) {
const connection = await internals.getConnection();
// Since commit/rollback/beginTransaction uses the .query it will auto promisify them
connection.query = Util.promisify(connection.query);
return connection;
}
let connection;

@@ -49,6 +38,14 @@ try {

catch (err) {
return callback(err);
if (callback) {
return callback(err);
}
throw err;
}
return callback(null, connection);
if (callback) {
return callback(null, connection);
}
return connection;
};

@@ -68,2 +65,7 @@

// Since commit/rollback/beginTransaction uses the .query it will auto promisify them
// Node's `util.promisify` adds a symbol with the promisified version of the function
// After promisifying `connection.query` also still works with callbacks
connection.query = Util.promisify(connection.query);
return resolve(connection);

@@ -161,5 +163,3 @@ });

server.log(['hapi-plugin-mysql', 'database'], 'Connection to the database successful');
}
};
{
"name": "hapi-plugin-mysql",
"version": "7.2.6",
"version": "7.2.7",
"description": "Hapi plugin for MySQL",

@@ -9,3 +9,3 @@ "main": "lib/index.js",

"lint": "eslint --fix .",
"test": "lab -a @hapi/code -vL --lint-fix -t 96"
"test": "lab -m 5000 -a @hapi/code -vL --lint-fix -t 95"
},

@@ -12,0 +12,0 @@ "repository": {

@@ -456,3 +456,23 @@ 'use strict';

});
it('Promisified `.query` usage with callbacks', async () => {
const MySQLPlugin = require('..');
await MySQLPlugin.init(internals.dbOptions);
const connection = await MySQLPlugin.getConnection();
return new Promise((resolve) => {
return connection.query('INSERT INTO test SET id = null', (err, results) => {
expect(err, 'error').to.not.exist();
expect(results.insertId, 'insert Id').to.exist();
return resolve();
});
});
});
});
});