Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

352 B
Raw Blame
import punycodeHelper from "punycode/";

export function punycode(str?: string | null) {
  if (typeof str !== "string") return "";
  try {
    return punycodeHelper.toUnicode(str);
  } catch (e) {
    return str;
  }
}

export function punyEncode(str?: string | null) {
  if (typeof str !== "string") return "";
  return punycodeHelper.toASCII(str);
}