Require statements break Browserify compatibility

This commit is contained in:
Joost Farla 2015-10-10 11:10:51 +02:00
parent 261a42a730
commit f50f5ce7e8
6 changed files with 14 additions and 14 deletions

View File

@ -4,10 +4,10 @@ var util = require('util');
var pgPass = require('pgpass'); var pgPass = require('pgpass');
var TypeOverrides = require('./type-overrides'); var TypeOverrides = require('./type-overrides');
var ConnectionParameters = require(__dirname + '/connection-parameters'); var ConnectionParameters = require('./connection-parameters');
var Query = require(__dirname + '/query'); var Query = require('./query');
var defaults = require(__dirname + '/defaults'); var defaults = require('./defaults');
var Connection = require(__dirname + '/connection'); var Connection = require('./connection');
var Client = function(config) { var Client = function(config) {
EventEmitter.call(this); EventEmitter.call(this);

View File

@ -1,7 +1,7 @@
var url = require('url'); var url = require('url');
var dns = require('dns'); var dns = require('dns');
var defaults = require(__dirname + '/defaults'); var defaults = require('./defaults');
var val = function(key, config, envVar) { var val = function(key, config, envVar) {
if (envVar === undefined) { if (envVar === undefined) {

View File

@ -1,9 +1,9 @@
var EventEmitter = require('events').EventEmitter; var EventEmitter = require('events').EventEmitter;
var util = require('util'); var util = require('util');
var Client = require(__dirname+'/client'); var Client = require('./client');
var defaults = require(__dirname + '/defaults'); var defaults = require('./defaults');
var pool = require(__dirname + '/pool'); var pool = require('./pool');
var Connection = require(__dirname + '/connection'); var Connection = require('./connection');
var PG = function(clientConstructor) { var PG = function(clientConstructor) {
EventEmitter.call(this); EventEmitter.call(this);

View File

@ -5,7 +5,7 @@ var pkg = require('../../package.json');
var assert = require('assert'); var assert = require('assert');
var EventEmitter = require('events').EventEmitter; var EventEmitter = require('events').EventEmitter;
var util = require('util'); var util = require('util');
var ConnectionParameters = require(__dirname + '/../connection-parameters'); var ConnectionParameters = require('../connection-parameters');
var msg = 'Version >= ' + pkg.minNativeVersion + ' of pg-native required.'; var msg = 'Version >= ' + pkg.minNativeVersion + ' of pg-native required.';
assert(semver.gte(Native.version, pkg.minNativeVersion), msg); assert(semver.gte(Native.version, pkg.minNativeVersion), msg);

View File

@ -1,13 +1,13 @@
var EventEmitter = require('events').EventEmitter; var EventEmitter = require('events').EventEmitter;
var defaults = require(__dirname + '/defaults'); var defaults = require('./defaults');
var genericPool = require('generic-pool'); var genericPool = require('generic-pool');
var pools = { var pools = {
//dictionary of all key:pool pairs //dictionary of all key:pool pairs
all: {}, all: {},
//reference to the client constructor - can override in tests or for require('pg').native //reference to the client constructor - can override in tests or for require('pg').native
Client: require(__dirname + '/client'), Client: require('./client'),
getOrCreate: function(clientConfig) { getOrCreate: function(clientConfig) {
clientConfig = clientConfig || {}; clientConfig = clientConfig || {};
var name = JSON.stringify(clientConfig); var name = JSON.stringify(clientConfig);

View File

@ -1,8 +1,8 @@
var EventEmitter = require('events').EventEmitter; var EventEmitter = require('events').EventEmitter;
var util = require('util'); var util = require('util');
var Result = require(__dirname + '/result'); var Result = require('./result');
var utils = require(__dirname + '/utils'); var utils = require('./utils');
var Query = function(config, values, callback) { var Query = function(config, values, callback) {
// use of "new" optional // use of "new" optional