mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 21:15:18 +09:00
14 lines
413 B
TypeScript
14 lines
413 B
TypeScript
import { type AllUserProps, type DeleteProp } from "@webstudio-is/sdk";
|
|
|
|
export const deletePropMutable = (
|
|
allProps: AllUserProps,
|
|
deleteProp: DeleteProp
|
|
) => {
|
|
const prop = allProps[deleteProp.instanceId];
|
|
if (prop === undefined) return false;
|
|
const index = prop.props.findIndex(({ id }) => id === deleteProp.propId);
|
|
if (index === -1) return false;
|
|
prop.props.splice(index, 1);
|
|
return true;
|
|
};
|