{"version":3,"file":"_isFormatIpv6.mjs","names":[],"sources":["../../src/internal/_isFormatIpv6.ts"],"sourcesContent":["/**\n * Checks the RFC 4291 text spelling of the `ipv6` format.\n *\n * Accepts eight groups of one to four hexadecimal digits, one `::` compression\n * and an embedded dotted IPv4 tail, ignoring case. A zone identifier and a\n * prefix length are not accepted.\n *\n * @evidence contracts/common.md#principled-implementation The expression enumerates the RFC 4291 text forms: eight groups, each position of a single `::` compression and an embedded dotted IPv4 tail, ignoring case; a zone identifier and a prefix length are not part of the grammar.\n * @evidence contracts/common.md#clear-and-simple-design One predicate and one private pattern, identical to the copy in @typia/utils; the pattern is long because the compression positions are listed, and no helper is split off.\n * @evidence contracts/common.md#prohibited-implementation-shortcuts The forms are the standard's, with no address special-cased.\n * @evidence contracts/common.md#meaningful-documentation The doc lists the accepted forms and the excluded suffixes.\n */\nexport const _isFormatIpv6 = (str: string): boolean => PATTERN.test(str);\n\nconst PATTERN =\n  /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\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