mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 20:49:06 +01:00
24 lines
446 B
TypeScript
24 lines
446 B
TypeScript
const WebFinger = require('webfinger.js');
|
|
|
|
const webFinger = new WebFinger({ });
|
|
|
|
type ILink = {
|
|
href: string;
|
|
rel: string;
|
|
};
|
|
|
|
type IWebFinger = {
|
|
links: ILink[];
|
|
subject: string;
|
|
};
|
|
|
|
export default async function resolve(query: any): Promise<IWebFinger> {
|
|
return await new Promise((res, rej) => webFinger.lookup(query, (error: Error, result: any) => {
|
|
if (error) {
|
|
return rej(error);
|
|
}
|
|
|
|
res(result.object);
|
|
})) as IWebFinger;
|
|
}
|