[backend] [client] Import the proper userland punycode module

This commit is contained in:
Laura Hausmann 2023-11-25 03:52:14 +01:00
parent 9cc900faae
commit 13e93dc461
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 4 additions and 4 deletions

View file

@ -1,6 +1,6 @@
import { URL } from "node:url"; import { URL } from "node:url";
import config from "@/config/index.js"; import config from "@/config/index.js";
import { toASCII } from "punycode"; import punycode from "punycode/";
export function getFullApAccount(username: string, host: string | null) { export function getFullApAccount(username: string, host: string | null) {
return host return host
@ -19,10 +19,10 @@ export function extractDbHost(uri: string) {
} }
export function toPuny(host: string) { export function toPuny(host: string) {
return toASCII(host.toLowerCase()); return punycode.toASCII(host.toLowerCase());
} }
export function toPunyNullable(host: string | null | undefined): string | null { export function toPunyNullable(host: string | null | undefined): string | null {
if (host == null) return null; if (host == null) return null;
return toASCII(host.toLowerCase()); return punycode.toASCII(host.toLowerCase());
} }

View file

@ -34,7 +34,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { toUnicode } from "punycode"; import { toUnicode } from "punycode/";
import {} from "vue"; import {} from "vue";
import { host as localHost } from "@/config"; import { host as localHost } from "@/config";
import { $i } from "@/account"; import { $i } from "@/account";