CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-punycode

A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.

93

1.17x

Quality

Pending

Does it follow best practices?

Impact

93%

1.17x

Average score across 10 eval scenarios

Overview
Eval results
Files

task.mdevals/scenario-8/

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

Install with Tessl CLI

npx tessl i tessl/npm-punycode

tile.json