Use native assert
This commit is contained in:
parent
2e9f064e7e
commit
f366e4b0cc
|
@ -5,11 +5,11 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var assert = require("assert");
|
||||||
var bufferEqual = require("buffer-equal");
|
var bufferEqual = require("buffer-equal");
|
||||||
var bs58 = require("bs58");
|
var bs58 = require("bs58");
|
||||||
var varint = require("./varint");
|
var varint = require("./varint");
|
||||||
var bmcrypto = require("./crypto");
|
var bmcrypto = require("./crypto");
|
||||||
var assert = require("./utils").assert;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse Bitmessage Base58 encoded address (with or without `BM-`
|
* Parse Bitmessage Base58 encoded address (with or without `BM-`
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var assert = require("assert");
|
||||||
require("es6-promise").polyfill();
|
require("es6-promise").polyfill();
|
||||||
var ripemd160 = require("ripemd160");
|
var ripemd160 = require("ripemd160");
|
||||||
var assert = require("./utils").assert;
|
|
||||||
|
|
||||||
// Support `webkit` prefix for Safari (not tested yet).
|
// Support `webkit` prefix for Safari (not tested yet).
|
||||||
// TODO(Kagami): Try to support IE11.
|
// TODO(Kagami): Try to support IE11.
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
"use strict";
|
|
||||||
|
|
||||||
exports.assert = function(condition, message) {
|
|
||||||
if (!condition) {
|
|
||||||
throw new Error(message || "Assertion failed");
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -5,12 +5,12 @@
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
var assert = require("assert");
|
||||||
// TODO(Kagami): Since `node-int64` and `int64-native` APIs are slightly
|
// TODO(Kagami): Since `node-int64` and `int64-native` APIs are slightly
|
||||||
// differ, there might be need in platform-dependent wrapper. Also think
|
// differ, there might be need in platform-dependent wrapper. Also think
|
||||||
// that to do with 64bit arithmetic since `node-int64` doesn't implement
|
// that to do with 64bit arithmetic since `node-int64` doesn't implement
|
||||||
// it.
|
// it.
|
||||||
var Int64 = require("int64-native");
|
var Int64 = require("int64-native");
|
||||||
var assert = require("./utils").assert;
|
|
||||||
|
|
||||||
exports.decode = function(buf) {
|
exports.decode = function(buf) {
|
||||||
assert(buf.length > 0, "Empty buffer");
|
assert(buf.length > 0, "Empty buffer");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user