[ { "search": "let context = canvas.getContext(\"2d\");", "replace": "" }, { "search": "const SQ = squareSize = 20;", "replace": "const SQ = squareSize = 20;\n\n if (!canvas) {\n throw new Error('Canvas element not found');\n }\n\n let context = canvas.getContext(\"2d\");\n\n if (!context) {\n throw new Error('Canvas context not found');\n }" } ]