Change utility naming

This commit is contained in:
Braydon Fuller 2014-12-12 11:05:22 -05:00
parent 1858766627
commit 32ac9bb63e
4 changed files with 6 additions and 7 deletions

View File

@ -3,7 +3,7 @@
var base58check = require('./encoding/base58check'); var base58check = require('./encoding/base58check');
var Networks = require('./networks'); var Networks = require('./networks');
var Hash = require('./crypto/hash'); var Hash = require('./crypto/hash');
var jsUtil = require('./util/js'); var JSUtil = require('./util/js');
/** /**
* Instantiate an address from an address String or Buffer, a public key or script hash Buffer, * Instantiate an address from an address String or Buffer, a public key or script hash Buffer,
@ -313,7 +313,7 @@ Address.fromString = function(str, network, type) {
* @returns {Address} A new valid instance of an Address * @returns {Address} A new valid instance of an Address
*/ */
Address.fromJSON = function fromJSON(json) { Address.fromJSON = function fromJSON(json) {
if (jsUtil.isValidJson(json)) { if (JSUtil.isValidJson(json)) {
json = JSON.parse(json); json = JSON.parse(json);
} }
var hashBuffer = new Buffer(json.hash, 'hex'); var hashBuffer = new Buffer(json.hash, 'hex');

View File

@ -2,7 +2,6 @@
var _ = require('lodash'); var _ = require('lodash');
var BufferUtil = require('./util/buffer'); var BufferUtil = require('./util/buffer');
var jsUtil = require('./util/js');
/** /**
* A network is merely a map containing values that correspond to version * A network is merely a map containing values that correspond to version

View File

@ -1,6 +1,6 @@
'use strict'; 'use strict';
var jsUtil = require('./util/js'); var JSUtil = require('./util/js');
/** /**
* *
@ -63,7 +63,7 @@ Object.keys(UNITS).forEach(function(key) {
* @returns {Unit} A Unit instance * @returns {Unit} A Unit instance
*/ */
Unit.fromJSON = function fromJSON(json){ Unit.fromJSON = function fromJSON(json){
if (jsUtil.isValidJson(json)) { if (JSUtil.isValidJson(json)) {
json = JSON.parse(json); json = JSON.parse(json);
} }
return new Unit(json.amount, json.code); return new Unit(json.amount, json.code);

View File

@ -5,7 +5,7 @@ var URL = require('url');
var Address = require('./address'); var Address = require('./address');
var Unit = require('./unit'); var Unit = require('./unit');
var jsUtil = require('./util/js'); var JSUtil = require('./util/js');
/** /**
* Bitcore URI * Bitcore URI
@ -68,7 +68,7 @@ URI.fromString = function fromString(str) {
* @returns {URI} A new instance of a URI * @returns {URI} A new instance of a URI
*/ */
URI.fromJSON = function fromJSON(json) { URI.fromJSON = function fromJSON(json) {
if (jsUtil.isValidJson(json)) { if (JSUtil.isValidJson(json)) {
json = JSON.parse(json); json = JSON.parse(json);
} }
return new URI(json); return new URI(json);