blockly > Names > getName

Names.getName() method

Convert a Blockly entity name to a legal exportable entity name.

Signature:

getName(nameOrId: string, type: NameType | string): string;

Parameters

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

Returns:

string

An entity name that is legal in the exported language.