A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.
93
Quality
Pending
Does it follow best practices?
Impact
93%
1.17xAverage score across 10 eval scenarios
{
"context": "Evaluates whether the solution relies on the punycode package to convert single domain labels and preserves its RangeError signaling for malformed input. Focuses on using the library API rather than manual parsing or encoding.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Decode via punycode",
"description": "ASCII label decoding uses punycode.decode (or punycode.toUnicode for labels) instead of manual parsing, preserving builtin RangeError handling.",
"max_score": 35
},
{
"name": "Encode via punycode",
"description": "Unicode label encoding uses punycode.encode (or punycode.toASCII for labels) directly, avoiding custom encoders and letting the library handle edge cases.",
"max_score": 25
},
{
"name": "Invalid digit RangeError",
"description": "Decoding a label containing invalid punycode digits (e.g., 'xn--abc!') is implemented to let punycode throw RangeError without suppression.",
"max_score": 20
},
{
"name": "Overflow RangeError",
"description": "Decoding an overflow-inducing label (e.g., 'xn--9999999999') surfaces the RangeError from punycode rather than converting or masking the failure.",
"max_score": 20
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-punycodedocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10