thetatoken/theta-wallet-web

Avoid polluting BigNumber prototype

Opened this issue · 0 comments

Since it's used only in 1 place, this can be avoided:

BigNumber.prototype.pad = function(size) {
var s = String(this);
while (s.length < (size || 2)) {s = "0" + s;}
return s;
};

and replaced using lodash padStart(x, 2, '0').
Not a good practice to pollute prototype for libs being reused elsewhere in a project.