or run

npx @tessl/cli init
Log in

Version

Files

docs

index.md
tile.json

task.mdevals/scenario-6/

Punycode Label Encoder

A module that converts a single Unicode host label into an ASCII Punycode label for DNS-safe usage while leaving already-ASCII labels unchanged.

Capabilities

Convert common accents

  • "mañana" is encoded to "maana-pta" @test

Convert umlauted words

  • "bücher" is encoded to "bcher-kva" @test

Preserve ASCII-only labels

  • "example" is returned unchanged @test

Implementation

@generates

API

/**
 * Transforms a single domain label into its ASCII representation.
 * @param {string} label - Unicode label without separators.
 * @returns {string} ASCII label encoded with Punycode when needed.
 * @throws {RangeError} Propagates if the dependency rejects the input.
 */
export function encodeLabel(label);

Dependencies { .dependencies }

punycode { .dependency }

Provides conversion utilities between Unicode labels and Punycode ASCII for IDNA-safe host components.