or run

npx @tessl/cli init
Log in

Version

Files

docs

index.md
tile.json

task.mdevals/scenario-10/

Punycode Label Guard

A small utility that converts individual domain labels between Unicode and their ASCII Punycode form while surfacing RangeError for malformed or unrepresentable inputs.

Capabilities

Round-trips valid label

  • Unicode label mañana converts to an ASCII Punycode label and decoding returns mañana @test

Rejects invalid digit

  • Decoding the ASCII label xn--abc! raises a RangeError to indicate an invalid Punycode digit @test

Rejects overflow

  • Decoding the ASCII label xn--9999999999 raises a RangeError caused by numeric overflow in the Punycode input @test

Implementation

@generates

API

/**
 * Converts a single Unicode domain label to its ASCII Punycode representation.
 * Must surface the dependency's RangeError when the label cannot be encoded safely.
 */
export function toAsciiLabel(unicodeLabel) {}

/**
 * Converts a single ASCII Punycode label back to Unicode.
 * Must surface the dependency's RangeError when the input contains invalid digits or overflows.
 */
export function toUnicodeLabel(asciiLabel) {}

Dependencies { .dependencies }

punycode { .dependency }

Use the official Punycode implementation for label conversions, relying on its RangeError signaling for invalid digits and overflow. @satisfied-by