@roochnetwork/rooch-sdk
Version:
21 lines (20 loc) • 397 B
JavaScript
const toShortStr = (input, shortOpt = {
start: 6,
end: 6
}) => {
try {
if (input.length <= shortOpt.start + shortOpt.end) {
return input;
}
return `${input.substring(0, shortOpt.start)}...${input.substring(
input.length - shortOpt.end,
input.length
)}`;
} catch (error) {
return "";
}
};
export {
toShortStr
};
//# sourceMappingURL=address.js.map