mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-11 19:40:08 +02:00
Prefer arrow functions and callbacks (#1210)
This commit is contained in:
@@ -100,10 +100,7 @@ export const shapesShortcutKeys = SHAPES.map((shape, index) => [
|
||||
(index + 1).toString(),
|
||||
]).flat(1);
|
||||
|
||||
export function findShapeByKey(key: string) {
|
||||
return (
|
||||
SHAPES.find((shape, index) => {
|
||||
return shape.key === key.toLowerCase() || key === (index + 1).toString();
|
||||
})?.value || "selection"
|
||||
);
|
||||
}
|
||||
export const findShapeByKey = (key: string) =>
|
||||
SHAPES.find((shape, index) => {
|
||||
return shape.key === key.toLowerCase() || key === (index + 1).toString();
|
||||
})?.value || "selection";
|
||||
|
Reference in New Issue
Block a user