From 5e5221e0c3484397d16de3c7b47e33a4a9ae1ca0 Mon Sep 17 00:00:00 2001 From: Tai Zeming Date: Tue, 9 May 2023 00:59:56 +0800 Subject: [PATCH] fix(log): Avoid type conflict (#347) * Avoid type conflict * Prettier format * Make extras optional * Rename extras to keyValues * Remove empty initial object --- plugins/log/guest-js/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/log/guest-js/index.ts b/plugins/log/guest-js/index.ts index 4fb4b0c9..77ab7009 100644 --- a/plugins/log/guest-js/index.ts +++ b/plugins/log/guest-js/index.ts @@ -4,7 +4,8 @@ import { listen, UnlistenFn } from "@tauri-apps/api/event"; export type LogOptions = { file?: string; line?: number; -} & Record; + keyValues?: Record; +}; enum LogLevel { /** @@ -50,7 +51,7 @@ async function log( return name.length > 0 && location !== "[native code]"; }); - const { file, line, ...keyValues } = options ?? {}; + const { file, line, keyValues } = options ?? {}; let location = filtered?.[0]?.filter((v) => v.length > 0).join("@"); if (location === "Error") {