mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-19 15:31:04 +02:00
prevent newElementWith from accepting undefined values
This commit is contained in:
@@ -84,9 +84,12 @@ export const mutateElement = <TElement extends Mutable<ExcalidrawElement>>(
|
||||
Scene.getScene(element)?.informMutation();
|
||||
};
|
||||
|
||||
export const newElementWith = <TElement extends ExcalidrawElement>(
|
||||
export const newElementWith = <
|
||||
TElement extends ExcalidrawElement,
|
||||
K extends keyof Omit<TElement, "id" | "version" | "versionNonce">
|
||||
>(
|
||||
element: TElement,
|
||||
updates: ElementUpdate<TElement>,
|
||||
updates: Pick<TElement, K>,
|
||||
): TElement => ({
|
||||
...element,
|
||||
...updates,
|
||||
|
Reference in New Issue
Block a user