Break down relay utils, replace removeNil with removeUndefined
This commit is contained in:
@@ -19,14 +19,14 @@ import {get} from "svelte/store"
|
||||
import type {Writable} from "svelte/store"
|
||||
import type {NodeViewProps} from "@tiptap/core"
|
||||
import {Router} from "@welshman/router"
|
||||
import {removeNil} from "@welshman/lib"
|
||||
import {removeUndefined} from "@welshman/lib"
|
||||
import type {FileAttributes} from "@welshman/editor"
|
||||
import {Editor, MentionSuggestion, WelshmanExtension} from "@welshman/editor"
|
||||
import {profileSearch, deriveProfileDisplay} from "@welshman/app"
|
||||
|
||||
export const MentionNodeView = ({node}: NodeViewProps) => {
|
||||
const dom = document.createElement("span")
|
||||
const display = deriveProfileDisplay(node.attrs.pubkey, removeNil([url]))
|
||||
const display = deriveProfileDisplay(node.attrs.pubkey, removeUndefined([url]))
|
||||
|
||||
dom.classList.add("tiptap-object")
|
||||
|
||||
|
||||
+1
-1
@@ -324,7 +324,7 @@ export declare const toIterable: (x: any) => any;
|
||||
export declare const ensurePlural: <T>(x: T | T[]) => T[];
|
||||
|
||||
// Ensures values are not undefined
|
||||
export declare const removeNil: <T>(xs: T[]) => (T & {})[];
|
||||
export declare const removeUndefined: <T>(xs: T[]) => (T & {})[];
|
||||
|
||||
// Returns a list of overlapping pairs of elements in xs
|
||||
export declare const overlappingPairs: <T>(xs: T[]) => T[][];
|
||||
|
||||
Reference in New Issue
Block a user