Use own assert

Because it weights much less that than the browserify's one.
This commit is contained in:
Kagami Hiiragi 2015-01-05 16:31:28 +03:00
parent e6d4e4c029
commit b8b6294f95
4 changed files with 10 additions and 3 deletions

View File

@ -7,9 +7,9 @@
"use strict";
require("object.assign").shim();
var assert = require("assert");
var bufferEqual = require("buffer-equal");
var bs58 = require("bs58");
var assert = require("./util").assert;
var var_int = require("./structs").var_int;
var bmcrypto = require("./crypto");

View File

@ -7,8 +7,8 @@
"use strict";
require("object.assign").shim();
var assert = require("assert");
var bufferEqual = require("buffer-equal");
var assert = require("./util").assert;
var bmcrypto = require("./crypto");
function isAscii(str) {

7
lib/util.js Normal file
View File

@ -0,0 +1,7 @@
"use strict";
exports.assert = function(condition, message) {
if (!condition) {
throw new Error(message || "Assertion failed");
}
};

View File

@ -6,9 +6,9 @@
"use strict";
var assert = require("assert");
var bufferEqual = require("buffer-equal");
var bs58 = require("bs58");
var assert = require("./util").assert;
var bmcrypto = require("./crypto");
// Compute the WIF checksum for the given data.