mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-10 07:27:23 +02:00
style: apply prettier formatting
This commit is contained in:
@@ -55,7 +55,9 @@ export default function PreviewEventPage() {
|
||||
// Validate that we got an event-type entity
|
||||
useEffect(() => {
|
||||
if (decoded && decoded.type !== "nevent" && decoded.type !== "note") {
|
||||
toast.error(`Invalid identifier type: expected nevent or note, got ${decoded.type}`);
|
||||
toast.error(
|
||||
`Invalid identifier type: expected nevent or note, got ${decoded.type}`,
|
||||
);
|
||||
}
|
||||
}, [decoded]);
|
||||
|
||||
|
||||
@@ -105,9 +105,7 @@ describe("useNip19Decode", () => {
|
||||
});
|
||||
|
||||
it("should handle invalid identifier format", () => {
|
||||
const { result } = renderHook(() =>
|
||||
useNip19Decode("invalid-identifier")
|
||||
);
|
||||
const { result } = renderHook(() => useNip19Decode("invalid-identifier"));
|
||||
|
||||
expect(result.current.decoded).toBeNull();
|
||||
expect(result.current.error).toBeTruthy();
|
||||
@@ -115,7 +113,7 @@ describe("useNip19Decode", () => {
|
||||
|
||||
it("should handle corrupted bech32 string", () => {
|
||||
const { result } = renderHook(() =>
|
||||
useNip19Decode("npub1invalidbech32string")
|
||||
useNip19Decode("npub1invalidbech32string"),
|
||||
);
|
||||
|
||||
expect(result.current.decoded).toBeNull();
|
||||
@@ -130,7 +128,7 @@ describe("useNip19Decode", () => {
|
||||
({ id }: { id: string | undefined }) => useNip19Decode(id),
|
||||
{
|
||||
initialProps: { id: npub as string },
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const firstResult = result.current;
|
||||
@@ -149,7 +147,7 @@ describe("useNip19Decode", () => {
|
||||
({ id }: { id: string | undefined }) => useNip19Decode(id),
|
||||
{
|
||||
initialProps: { id: npub as string },
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
expect(result.current.decoded?.type).toBe("npub");
|
||||
|
||||
@@ -50,7 +50,7 @@ export interface UseNip19DecodeResult {
|
||||
*/
|
||||
export function useNip19Decode(
|
||||
identifier: string | undefined,
|
||||
expectedType?: Nip19EntityType
|
||||
expectedType?: Nip19EntityType,
|
||||
): UseNip19DecodeResult {
|
||||
return useMemo(() => {
|
||||
if (!identifier) {
|
||||
|
||||
Reference in New Issue
Block a user