From 3d2626235765cac48a9e3cc5b32727d646a38654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thierry=20K=C3=BChni?= Date: Wed, 31 Jul 2024 15:10:08 +0200 Subject: [PATCH] Remove unused function --- src/lib/Group.svelte | 1 - src/lib/Label.svelte | 1 - src/lib/util/object.ts | 14 -------------- 3 files changed, 16 deletions(-) delete mode 100644 src/lib/util/object.ts diff --git a/src/lib/Group.svelte b/src/lib/Group.svelte index c995369..5729161 100644 --- a/src/lib/Group.svelte +++ b/src/lib/Group.svelte @@ -29,7 +29,6 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Group.html), type KonvaParent } from '$lib/util/manageContext'; import { registerEvents } from '$lib/util/events'; - import { copyExistingKeys } from '$lib/util/object'; import { type PropsContainer, type Props } from '$lib/util/props'; let { diff --git a/src/lib/Label.svelte b/src/lib/Label.svelte index 8888cb7..f81d1fb 100644 --- a/src/lib/Label.svelte +++ b/src/lib/Label.svelte @@ -23,7 +23,6 @@ Further information: [Konva API docs](https://konvajs.org/api/Konva.Label.html), import Konva from 'konva'; import { onMount, onDestroy } from 'svelte'; import { writable, type Writable } from 'svelte/store'; - import { copyExistingKeys } from '$lib/util/object'; import { Container, getParentContainer, diff --git a/src/lib/util/object.ts b/src/lib/util/object.ts deleted file mode 100644 index 049feb0..0000000 --- a/src/lib/util/object.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ - -/** - * Only copies fields from the source object that already exist on the target object, skipping everything else - * @param target - * @param source - */ -export function copyExistingKeys(target: { [key: string]: any }, source: { [key: string]: any }) { - for (const key in target) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } -}