Stay organized with collections Save and categorize content based on your preferences.

blockly > Names > getDistinctName

Names.getDistinctName() method

Convert a Blockly entity name to a legal exportable entity name. Ensure that this is a new name not overlapping any previously defined name. Also check against list of reserved words for the current language and ensure name doesn't collide.


getDistinctName(name: string, type: NameType | string): string;


Parameter Type Description
name string The Blockly entity name (no constraints).
type NameType | string The type of entity in Blockly ('VARIABLE', 'PROCEDURE', 'DEVELOPER_VARIABLE', etc...).



An entity name that is legal in the exported language.