google / blockly

The web-based visual programming editor.
https://developers.google.com/blockly/
Apache License 2.0
12.52k stars 3.72k forks source link

refactor: Convert renderer typecheck methods to typeguards. #8656

Open gonfunko opened 2 weeks ago

gonfunko commented 2 weeks ago

The basics

The details

Resolves

Fixes #6997

Proposed Changes

This PR converts the various methods for checking the types of measurables in renderers/measurables/types.ts to be typeguards, and updates the code that calls them to remove now-unnecessary casts and instanceof checks.