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-4/

Unicode Code Point Adapter

Build a small module that translates between JavaScript strings and arrays of Unicode code points without losing surrogate pair information.

Capabilities

Convert text to code points

  • "Hi \\uD83D\\uDE00" yields [72, 105, 32, 128512] @test
  • "\\uD83Dabc" yields [55357, 97, 98, 99] preserving the lone surrogate half instead of dropping or replacing it @test

Convert code points to text

  • [0x48, 0x69, 0x20, 0x1F680] renders "Hi \\uD83D\\uDE80" @test
  • [0xD834, 0xDF06, 0xD800] renders "\\uD834\\uDF06\\uD800", combining valid pairs while leaving the unmatched half untouched @test

Preserve inputs

  • Converting [0xD83D, 0xDE03] returns "\\uD83D\\uDE03" without mutating the provided array after the call @test

Implementation

@generates

API

export function toCodePoints(input: string): number[];
export function fromCodePoints(codePoints: readonly number[]): string;

Dependencies { .dependencies }

punycode { .dependency }

Provides UCS-2/Unicode conversion helpers for bridging JS strings and code point arrays.

Install with Tessl CLI

npx tessl i tessl/npm-punycode

tile.json