From 1112b131c1db1add55d9e7634dd226d1a1e313aa Mon Sep 17 00:00:00 2001 From: Nick Winans Date: Fri, 23 Jun 2023 14:36:41 -0500 Subject: [PATCH] Fix punycode --- package-lock.json | 4 ++-- public/punycode.js | 1 + src/pages/index.astro | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 public/punycode.js diff --git a/package-lock.json b/package-lock.json index 1405d4e..afae8f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@example/basics", + "name": "l62.ng", "version": "0.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@example/basics", + "name": "l62.ng", "version": "0.0.1", "devDependencies": { "astro": "^1.0.0-beta.72" diff --git a/public/punycode.js b/public/punycode.js new file mode 100644 index 0000000..8cbbb6a --- /dev/null +++ b/public/punycode.js @@ -0,0 +1 @@ +"use strict";const maxInt=2147483647,base=36,tMin=1,tMax=26,skew=38,damp=700,initialBias=72,initialN=128,delimiter="-",regexPunycode=/^xn--/,regexNonASCII=/[^\0-\x7F]/,regexSeparators=/[\x2E\u3002\uFF0E\uFF61]/g,errors={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},baseMinusTMin=35,floor=Math.floor,stringFromCharCode=String.fromCharCode;function error(o){throw new RangeError(errors[o])}function map(o,e){const r=[];let t=o.length;for(;t--;)r[t]=e(o[t]);return r}function mapDomain(o,e){const r=o.split("@");let t="";r.length>1&&(t=r[0]+"@",o=r[1]);return t+map((o=o.replace(regexSeparators,".")).split("."),e).join(".")}function ucs2decode(o){const e=[];let r=0;const t=o.length;for(;r=55296&&n<=56319&&rString.fromCodePoint(...o),basicToDigit=function(o){return o>=48&&o<58?o-48+26:o>=65&&o<91?o-65:o>=97&&o<123?o-97:36},digitToBasic=function(o,e){return o+22+75*(o<26)-((0!=e)<<5)},adapt=function(o,e,r){let t=0;for(o=r?floor(o/700):o>>1,o+=floor(o/e);o>455;t+=36)o=floor(o/35);return floor(t+36*o/(o+38))},decode=function(o){const e=[],r=o.length;let t=0,n=128,i=72,c=o.lastIndexOf("-");c<0&&(c=0);for(let r=0;r=128&&error("not-basic"),e.push(o.charCodeAt(r));for(let a=c>0?c+1:0;a=r&&error("invalid-input");const c=(s=o.charCodeAt(a++))>=48&&s<58?s-48+26:s>=65&&s<91?s-65:s>=97&&s<123?s-97:36;c>=36&&error("invalid-input"),c>floor((maxInt-t)/e)&&error("overflow"),t+=c*e;const d=n<=i?1:n>=i+26?26:n-i;if(cfloor(maxInt/l)&&error("overflow"),e*=l}const d=e.length+1;i=adapt(t-c,d,0==c),floor(t/d)>maxInt-n&&error("overflow"),n+=floor(t/d),t%=d,e.splice(t++,0,n)}var s;return String.fromCodePoint(...e)},encode=function(o){const e=[],r=(o=ucs2decode(o)).length;let t=128,n=0,i=72;for(const r of o)r<128&&e.push(stringFromCharCode(r));const c=e.length;let s=c;for(c&&e.push("-");s=t&&efloor((maxInt-n)/a)&&error("overflow"),n+=(r-t)*a,t=r;for(const r of o)if(rmaxInt&&error("overflow"),r===t){let o=n;for(let r=36;;r+=36){const t=r<=i?1:r>=i+26?26:r-i;if(o - +