emmet.sdk
Version:
Emmet.Bridge SDK library
15 lines • 501 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.shortenAddress = void 0;
function shortenAddress(address, first = 6, last = 6) {
const length = 42;
if (!address || first < 0 || last < 0 || last > length) {
return '';
}
if (first >= length) {
return address;
}
return `${address.slice(0, first)}…${address.slice(length - last, length)}`;
}
exports.shortenAddress = shortenAddress;
//# sourceMappingURL=shortenAddress.js.map