MCPcopy
hub / github.com/RaspberryPiFoundation/blockly / hasIcon

Method hasIcon

packages/blockly/core/block.ts:2435–2437  ·  view source on GitHub ↗

* @returns True if an icon with the given type exists on the block, * false otherwise.

(type: IconType<IIcon>)

Source from the content-addressed store, hash-verified

2433 * false otherwise.
2434 */
2435 hasIcon(type: IconType<IIcon>): boolean {
2436 return this.icons.some((icon) => icon.getType().equals(type));
2437 }
2438
2439 /**
2440 * @param type The type of the icon to retrieve. Prefer passing an `IconType`

Callers 6

addIconMethod · 0.95
removeIconMethod · 0.95
displayTextFunction · 0.80
preconditionFnFunction · 0.80
callbackFunction · 0.80
block_test.jsFile · 0.80

Calls 2

getTypeMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected