olympus-protocol-connector
Version:
Module made by Olympus Labs for easier access to the Olympus protocol through Javascript/Typescript
30 lines • 881 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var Ether = /** @class */ (function () {
function Ether() {
}
Ether.validateAddress = function (address) {
return address !== '' && /^(0x)?[0-9a-fA-F]{40}$/.test(address);
};
return Ether;
}());
exports.Ether = Ether;
var DateHelper = /** @class */ (function () {
function DateHelper() {
}
DateHelper.secondsToPresentDate = function (seconds) {
// If is 0, we set to now
if (seconds === 0) {
return new Date();
}
var date = new Date(seconds * 1000); // Date require milliseconds
// If is in the past, we set to now
if (date < new Date()) {
return new Date();
}
return date;
};
return DateHelper;
}());
exports.DateHelper = DateHelper;
//# sourceMappingURL=Utils.js.map