Browse Source

Fix naming

patch-2
Braydon Fuller 10 years ago
parent
commit
93502d1523
  1. 2
      lib/address.js
  2. 2
      lib/unit.js
  3. 2
      lib/uri.js

2
lib/address.js

@ -313,7 +313,7 @@ Address.fromString = function(str, network, type) {
* @returns {Address} A new valid instance of an Address
*/
Address.fromJSON = function fromJSON(json) {
if (JSUtil.isValidJson(json)) {
if (JSUtil.isValidJSON(json)) {
json = JSON.parse(json);
}
var hashBuffer = new Buffer(json.hash, 'hex');

2
lib/unit.js

@ -63,7 +63,7 @@ Object.keys(UNITS).forEach(function(key) {
* @returns {Unit} A Unit instance
*/
Unit.fromJSON = function fromJSON(json){
if (JSUtil.isValidJson(json)) {
if (JSUtil.isValidJSON(json)) {
json = JSON.parse(json);
}
return new Unit(json.amount, json.code);

2
lib/uri.js

@ -68,7 +68,7 @@ URI.fromString = function fromString(str) {
* @returns {URI} A new instance of a URI
*/
URI.fromJSON = function fromJSON(json) {
if (JSUtil.isValidJson(json)) {
if (JSUtil.isValidJSON(json)) {
json = JSON.parse(json);
}
return new URI(json);

Loading…
Cancel
Save