diff --git a/lib/client.js b/lib/client.js index 4ab8cb5d..d21da7ba 100644 --- a/lib/client.js +++ b/lib/client.js @@ -10,8 +10,6 @@ var Connection = require(__dirname + '/connection'); var CopyFromStream = require(__dirname + '/copystream').CopyFromStream; var CopyToStream = require(__dirname + '/copystream').CopyToStream; -var deprecate = require('deprecate'); - var Client = function(config) { EventEmitter.call(this); diff --git a/lib/defaults.js b/lib/defaults.js index 9f3cbb98..738908ee 100644 --- a/lib/defaults.js +++ b/lib/defaults.js @@ -33,12 +33,3 @@ module.exports = { //pool log function / boolean poolLog: false }; - -var deprecate = require('deprecate'); -//getter/setter to disable deprecation warnings -module.exports.__defineGetter__("hideDeprecationWarnings", function() { - return deprecate.silent; -}); -module.exports.__defineSetter__("hideDeprecationWarnings", function(val) { - deprecate.silence = val; -}); diff --git a/lib/deprecate.js b/lib/deprecate.js deleted file mode 100644 index c5876231..00000000 --- a/lib/deprecate.js +++ /dev/null @@ -1,25 +0,0 @@ -var os = require('os'); -var defaults = require(__dirname + '/defaults'); - -var hits = { -}; -var deprecate = module.exports = function(methodName, message) { - if(defaults.hideDeprecationWarnings) return; - if(hits[deprecate.caller]) return; - hits[deprecate.caller] = true; - process.stderr.write(os.EOL); - process.stderr.write('\x1b[31;1m'); - process.stderr.write('WARNING!!'); - process.stderr.write(os.EOL); - process.stderr.write(methodName); - process.stderr.write(os.EOL); - for(var i = 1; i < arguments.length; i++) { - process.stderr.write(arguments[i]); - process.stderr.write(os.EOL); - } - process.stderr.write('\x1b[0m'); - process.stderr.write(os.EOL); - process.stderr.write("You can silence these warnings with `require('pg').defaults.hideDeprecationWarnings = true`"); - process.stderr.write(os.EOL); - process.stderr.write(os.EOL); -}; diff --git a/lib/pool.js b/lib/pool.js index 1600ba7c..9cf9aabf 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -3,8 +3,6 @@ var EventEmitter = require('events').EventEmitter; var defaults = require(__dirname + '/defaults'); var genericPool = require('generic-pool'); -var deprecate = require('deprecate'); - var pools = { //dictionary of all key:pool pairs all: {}, diff --git a/lib/types/binaryParsers.js b/lib/types/binaryParsers.js index b1bfdd3a..7f0a89c6 100644 --- a/lib/types/binaryParsers.js +++ b/lib/types/binaryParsers.js @@ -1,5 +1,3 @@ -var deprecate = require('deprecate'); - var parseBits = function(data, bits, offset, invert, callback) { offset = offset || 0; invert = invert || false; @@ -47,12 +45,6 @@ var parseBits = function(data, bits, offset, invert, callback) { }; var parseFloatFromBits = function(data, precisionBits, exponentBits) { - deprecate('parsing and returning floats from PostgreSQL server is deprecated', - 'JavaScript has a hard time with floats and there is precision loss which can cause', - 'unexpected, hard to trace, potentially bad bugs in your program', - 'for more information see the following:', - 'https://github.com/brianc/node-postgres/pull/271', - 'in node-postgres v1.0.0 all floats & decimals will be returned as strings'); var bias = Math.pow(2, exponentBits - 1) - 1; var sign = parseBits(data, 1); var exponent = parseBits(data, exponentBits, 1); diff --git a/lib/types/textParsers.js b/lib/types/textParsers.js index c7525e82..61008b57 100644 --- a/lib/types/textParsers.js +++ b/lib/types/textParsers.js @@ -1,5 +1,3 @@ -var deprecate = require('deprecate'); - var arrayParser = require(__dirname + "/arrayParser.js"); //parses PostgreSQL server formatted date strings into javascript date objects