From 80625fdbefcd094e11f5d85bc0a351c24654f1f3 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Thu, 28 Aug 2014 20:27:45 -0700 Subject: [PATCH] move static isValid next to instance isValid ...to be easier for developers to parse and distinguish --- lib/address.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/address.js b/lib/address.js index b3b36f3..61399ad 100644 --- a/lib/address.js +++ b/lib/address.js @@ -10,15 +10,6 @@ function Address(obj) { this.set(obj); }; -Address.isValid = function(addrstr) { - try { - var address = new Address().fromString(addrstr); - } catch (e) { - return false; - } - return address.isValid(); -}; - Address.prototype.set = function(obj) { this.hashbuf = obj.hashbuf || this.hashbuf || null; this.networkstr = obj.networkstr || this.networkstr || 'mainnet'; @@ -60,6 +51,15 @@ Address.prototype.fromString = function(str) { return this; } +Address.isValid = function(addrstr) { + try { + var address = new Address().fromString(addrstr); + } catch (e) { + return false; + } + return address.isValid(); +}; + Address.prototype.isValid = function() { try { this.validate();