diff --git a/src/events.ts b/src/events.ts index a4d90eb..8ed8064 100644 --- a/src/events.ts +++ b/src/events.ts @@ -1,5 +1,5 @@ import {Event} from 'nostr-tools'; -import {zeroLeadingBitsCount} from './utils'; +import {zeroLeadingBitsCount} from './utils/crypto'; export const isMention = ([tag, , , marker]: string[]) => tag === 'e' && marker === 'mention'; export const hasEventTag = (tag: string[]) => tag[0] === 'e'; diff --git a/src/main.js b/src/main.js index 221d00f..940d882 100644 --- a/src/main.js +++ b/src/main.js @@ -1,9 +1,12 @@ import {generatePrivateKey, getEventHash, getPublicKey, nip19, signEvent} from 'nostr-tools'; +import {zeroLeadingBitsCount} from './utils/crypto'; +import {elem, elemCanvas, elemShrink, parseTextContent} from './utils/dom'; +import {bounce, dateTime, formatTime} from './utils/time'; +import {getHost, getNoxyUrl, isWssUrl} from './utils/url'; import {sub24hFeed, subNote, subProfile} from './subscriptions' import {publish} from './relays'; import {getReplyTo, hasEventTag, isMention, sortByCreatedAt, sortEventCreatedAt, validatePow} from './events'; import {clearView, getViewContent, getViewElem, setViewElem, view} from './view'; -import {bounce, dateTime, elem, elemCanvas, elemShrink, formatTime, getHost, getNoxyUrl, isWssUrl, parseTextContent, zeroLeadingBitsCount} from './utils'; // curl -H 'accept: application/nostr+json' https://relay.nostr.ch/ function onEvent(evt, relay) { diff --git a/src/utils/index.ts b/src/utils/index.ts deleted file mode 100644 index de96166..0000000 --- a/src/utils/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -export {zeroLeadingBitsCount} from './crypto'; -export {elem, elemCanvas, elemShrink, parseTextContent} from './dom'; -export {bounce, dateTime, formatTime} from './time'; -export {getHost, getNoxyUrl, isHttpUrl, isWssUrl} from './url'; diff --git a/src/view.ts b/src/view.ts index 8cbda1d..79d8b53 100644 --- a/src/view.ts +++ b/src/view.ts @@ -1,4 +1,4 @@ -import {elem} from './utils'; +import {elem} from './utils/dom'; type Container = { id: string;