parent
062ded9e6d
commit
32f39685a1
11
ldap.ts
11
ldap.ts
@ -19,7 +19,12 @@ export async function lookupPubkeyByUsername(username: string) {
|
|||||||
attributes: ["nostrKey"],
|
attributes: ["nostrKey"],
|
||||||
});
|
});
|
||||||
|
|
||||||
pubkey = searchEntries[0]?.nostrKey as string;
|
if (
|
||||||
|
searchEntries.length > 0 &&
|
||||||
|
typeof searchEntries[0].nostrKey === "string"
|
||||||
|
) {
|
||||||
|
pubkey = searchEntries[0].nostrKey;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
} finally {
|
} finally {
|
||||||
@ -40,7 +45,9 @@ export async function lookupUsernameByPubkey(pubkey: string) {
|
|||||||
attributes: ["cn"],
|
attributes: ["cn"],
|
||||||
});
|
});
|
||||||
|
|
||||||
username = searchEntries[0]?.cn;
|
if (searchEntries.length > 0) {
|
||||||
|
username = searchEntries[0].cn;
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -4,7 +4,7 @@ import { cleanContentHtml } from "../feeds.ts";
|
|||||||
|
|
||||||
describe("Feeds", () => {
|
describe("Feeds", () => {
|
||||||
describe("#cleanContentHtml", () => {
|
describe("#cleanContentHtml", () => {
|
||||||
let articleHtml = Deno.readTextFileSync(
|
const articleHtml = Deno.readTextFileSync(
|
||||||
"tests/fixtures/gfm-content-1.html",
|
"tests/fixtures/gfm-content-1.html",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user