utils: import directly from utils

it is not worth to import everything from utils, as there are too
many functions, better import them directly from each module.
pull/72/head
OFF0 2 years ago
parent 495e755844
commit 70fb0da35a
Signed by: offbyn
GPG Key ID: 94A2F643C51F37FA

@ -1,5 +1,5 @@
import {Event} from 'nostr-tools'; 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 isMention = ([tag, , , marker]: string[]) => tag === 'e' && marker === 'mention';
export const hasEventTag = (tag: string[]) => tag[0] === 'e'; export const hasEventTag = (tag: string[]) => tag[0] === 'e';

@ -1,9 +1,12 @@
import {generatePrivateKey, getEventHash, getPublicKey, nip19, signEvent} from 'nostr-tools'; 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 {sub24hFeed, subNote, subProfile} from './subscriptions'
import {publish} from './relays'; import {publish} from './relays';
import {getReplyTo, hasEventTag, isMention, sortByCreatedAt, sortEventCreatedAt, validatePow} from './events'; import {getReplyTo, hasEventTag, isMention, sortByCreatedAt, sortEventCreatedAt, validatePow} from './events';
import {clearView, getViewContent, getViewElem, setViewElem, view} from './view'; 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/ // curl -H 'accept: application/nostr+json' https://relay.nostr.ch/
function onEvent(evt, relay) { function onEvent(evt, relay) {

@ -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';

@ -1,4 +1,4 @@
import {elem} from './utils'; import {elem} from './utils/dom';
type Container = { type Container = {
id: string; id: string;

Loading…
Cancel
Save