From 83e51ad67eb313b730d30ad3af8a6c355a555df1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 21 May 2024 12:21:35 -0500 Subject: [PATCH] lodash -> entities --- deno.json | 1 + src/controllers/api/oauth.ts | 6 +++--- src/deps.ts | 2 -- src/views/mastodon/accounts.ts | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/deno.json b/deno.json index 1d9ad6d..1ebc35e 100644 --- a/deno.json +++ b/deno.json @@ -37,6 +37,7 @@ "@std/streams": "jsr:@std/streams@^0.223.0", "comlink": "npm:comlink@^4.4.1", "deno-safe-fetch": "https://gitlab.com/soapbox-pub/deno-safe-fetch/-/raw/v1.0.0/load.ts", + "entities": "npm:entities@^4.5.0", "fast-stable-stringify": "npm:fast-stable-stringify@^1.0.0", "formdata-helper": "npm:formdata-helper@^0.3.0", "hono": "https://deno.land/x/hono@v3.10.1/mod.ts", diff --git a/src/controllers/api/oauth.ts b/src/controllers/api/oauth.ts index a755a4d..c1407f4 100644 --- a/src/controllers/api/oauth.ts +++ b/src/controllers/api/oauth.ts @@ -1,9 +1,9 @@ import { encodeBase64 } from '@std/encoding/base64'; +import { escape } from 'entities'; import { nip19 } from 'nostr-tools'; import { z } from 'zod'; import { AppController } from '@/app.ts'; -import { lodash } from '@/deps.ts'; import { nostrNow } from '@/utils.ts'; import { parseBody } from '@/utils/api.ts'; import { getClientConnectUri } from '@/utils/connect.ts'; @@ -100,11 +100,11 @@ const oauthController: AppController = async (c) => {
- +

- Nostr Connect + Nostr Connect `); diff --git a/src/deps.ts b/src/deps.ts index 12be07f..dc9d912 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -1,6 +1,4 @@ import 'deno-safe-fetch'; -// @deno-types="npm:@types/lodash@4.14.194" -export { default as lodash } from 'https://esm.sh/lodash@4.17.21'; // @deno-types="npm:@types/sanitize-html@2.9.0" export { default as sanitizeHtml } from 'npm:sanitize-html@^2.11.0'; export { diff --git a/src/views/mastodon/accounts.ts b/src/views/mastodon/accounts.ts index b337167..69cf1db 100644 --- a/src/views/mastodon/accounts.ts +++ b/src/views/mastodon/accounts.ts @@ -1,8 +1,8 @@ import { NSchema as n } from '@nostrify/nostrify'; +import { escape } from 'entities'; import { nip19, UnsignedEvent } from 'nostr-tools'; import { Conf } from '@/config.ts'; -import { lodash } from '@/deps.ts'; import { type DittoEvent } from '@/interfaces/DittoEvent.ts'; import { getLnurl } from '@/utils/lnurl.ts'; import { nip05Cache } from '@/utils/nip05.ts'; @@ -53,7 +53,7 @@ async function renderAccount( header_static: banner, last_status_at: null, locked: false, - note: lodash.escape(about), + note: about ? escape(about) : '', roles: [], source: withSource ? {