Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp committed Dec 21, 2024
1 parent a1561f4 commit 7cb8a01
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"bundlesize": [
{
"path": "./packages/client/dist/xmpp.min.js",
"maxSize": "16 KB"
"maxSize": "17 KB"
}
],
"lint-staged": {
Expand Down
2 changes: 0 additions & 2 deletions packages/resolve/example.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { resolve } from "@xmpp/resolve";
// For you
// import { resolve } from "@xmpp/resolve";

resolve("jabberfr.org").then(console.log).catch(console.error);
9 changes: 6 additions & 3 deletions packages/resolve/lib/http.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
// eslint-disable-next-line n/no-unsupported-features/node-builtins
const fetch = globalThis.fetch || import("node-fetch");

// FIXME
// const fetch = globalThis.fetch || import("node-fetch");

import parse from "@xmpp/xml/lib/parse.js";
import { compare as compareAltConnections } from "./alt-connections.js";

export function resolve(domain) {
return fetch(`https://${domain}/.well-known/host-meta`)
// eslint-disable-next-line n/no-unsupported-features/node-builtins
return globalThis
.fetch(`https://${domain}/.well-known/host-meta`)
.then((res) => res.text())
.then((res) => {
return parse(res)
Expand Down

0 comments on commit 7cb8a01

Please sign in to comment.