blockly > Procedures > findLegalName

Procedures.findLegalName() function

Ensure two identically-named procedures don't exist. Take the proposed procedure name, and return a legal name i.e. one that is not empty and doesn't collide with other procedures.

Signature:

export declare function findLegalName(name: string, block: Block): string;

Parameters

Parameter Type Description
name string Proposed procedure name.
block Block Block to disambiguate.

Returns:

string

Non-colliding name.