"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.spanAllZeroes = spanAllZeroes; exports.spanAll = spanAll; exports.spanLeadingZeroes = spanLeadingZeroes; exports.simpleGroup = simpleGroup; /** * @returns {String} the string with all zeroes contained in a */ function spanAllZeroes(s) { return s.replace(/(0+)/g, '$1'); } /** * @returns {String} the string with each character contained in a */ function spanAll(s, offset = 0) { const letters = s.split(''); return letters .map((n, i) => `${spanAllZeroes(n)}`) .join(''); } function spanLeadingZeroesSimple(group) { return group.replace(/^(0+)/, '$1'); } /** * @returns {String} the string with leading zeroes contained in a */ function spanLeadingZeroes(address) { const groups = address.split(':'); return groups.map((g) => spanLeadingZeroesSimple(g)).join(':'); } /** * Groups an address * @returns {String} a grouped address */ function simpleGroup(addressString, offset = 0) { const groups = addressString.split(':'); return groups.map((g, i) => { if (/group-v4/.test(g)) { return g; } return `${spanLeadingZeroesSimple(g)}`; }); } //# sourceMappingURL=helpers.js.map