diff --git a/lib/index.js b/lib/index.js index 6bd6838d..5f1cea07 100644 --- a/lib/index.js +++ b/lib/index.js @@ -52,7 +52,8 @@ PG.prototype.cancel = function(config, client, query) { cancellingClient.cancel(client, query); }; -if (process.env.hasOwnProperty('NODE_PG_FORCE_NATIVE')) { +var forceNative = Object.prototype.hasOwnProperty.call(process.env, 'NODE_PG_FORCE_NATIVE'); +if (forceNative) { module.exports = new PG(require(__dirname + '/native')); } else { module.exports = new PG(Client);