mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
[backend] [client] Import the proper userland punycode module
This commit is contained in:
parent
9cc900faae
commit
13e93dc461
2 changed files with 4 additions and 4 deletions
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
||||||
|
|
Loading…
Reference in a new issue