From 4c41ce8c0a56c26b5e9e0b9cff0f01c085e1397c Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 2 Sep 2023 13:43:01 -0500 Subject: [PATCH] @/nip05.ts --> @/utils/nip05.ts --- src/controllers/api/search.ts | 2 +- src/transformers/nostr-to-mastoapi.ts | 2 +- src/utils.ts | 2 +- src/{ => utils}/nip05.ts | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename src/{ => utils}/nip05.ts (100%) diff --git a/src/controllers/api/search.ts b/src/controllers/api/search.ts index 6ba6183..ee8497e 100644 --- a/src/controllers/api/search.ts +++ b/src/controllers/api/search.ts @@ -2,11 +2,11 @@ import { AppController } from '@/app.ts'; import * as eventsDB from '@/db/events.ts'; import { type Event, type Filter, nip19, z } from '@/deps.ts'; import * as mixer from '@/mixer.ts'; -import { lookupNip05Cached } from '@/nip05.ts'; import { booleanParamSchema } from '@/schema.ts'; import { nostrIdSchema } from '@/schemas/nostr.ts'; import { toAccount, toStatus } from '@/transformers/nostr-to-mastoapi.ts'; import { dedupeEvents, Time } from '@/utils.ts'; +import { lookupNip05Cached } from '@/utils/nip05.ts'; /** Matches NIP-05 names with or without an @ in front. */ const ACCT_REGEX = /^@?(?:([\w.+-]+)@)?([\w.-]+)$/; diff --git a/src/transformers/nostr-to-mastoapi.ts b/src/transformers/nostr-to-mastoapi.ts index 8a6384a..ca8c411 100644 --- a/src/transformers/nostr-to-mastoapi.ts +++ b/src/transformers/nostr-to-mastoapi.ts @@ -3,12 +3,12 @@ import { isCWTag } from 'https://gitlab.com/soapbox-pub/mostr/-/raw/c67064aee5ad import { Conf } from '@/config.ts'; import * as eventsDB from '@/db/events.ts'; import { type Event, findReplyTag, lodash, nip19, sanitizeHtml, TTLCache, unfurl, z } from '@/deps.ts'; -import { verifyNip05Cached } from '@/nip05.ts'; import { getMediaLinks, type MediaLink, parseNoteContent } from '@/note.ts'; import { getAuthor, getFollowedPubkeys, getFollows } from '@/queries.ts'; import { emojiTagSchema, filteredArray } from '@/schema.ts'; import { jsonMetaContentSchema } from '@/schemas/nostr.ts'; import { isFollowing, type Nip05, nostrDate, parseNip05, Time } from '@/utils.ts'; +import { verifyNip05Cached } from '@/utils/nip05.ts'; const DEFAULT_AVATAR = 'https://gleasonator.com/images/avi.png'; const DEFAULT_BANNER = 'https://gleasonator.com/images/banner.png'; diff --git a/src/utils.ts b/src/utils.ts index d6d24d8..525c47f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,6 @@ import { type Event, nip19, z } from '@/deps.ts'; -import { lookupNip05Cached } from '@/nip05.ts'; import { getAuthor } from '@/queries.ts'; +import { lookupNip05Cached } from '@/utils/nip05.ts'; /** Get the current time in Nostr format. */ const nostrNow = (): number => Math.floor(Date.now() / 1000); diff --git a/src/nip05.ts b/src/utils/nip05.ts similarity index 100% rename from src/nip05.ts rename to src/utils/nip05.ts