MCPcopy Create free account
hub / github.com/Noumena-Network/code / isCellEmpty

Function isCellEmpty

src/ink/screen.ts:468–479  ·  view source on GitHub ↗
(screen: Screen, cell: Cell)

Source from the content-addressed store, hash-verified

466 * Check if a Cell (view object) represents an empty cell.
467 */
468export function isCellEmpty(screen: Screen, cell: Cell): boolean {
469 // Check if cell looks like an empty cell (space, empty style, narrow, no link).
470 // Note: After cellAt mapping, unwritten cells have emptyStyleId, so this
471 // returns true for both unwritten AND cleared cells. Use isEmptyCellAt
472 // for the internal distinction.
473 return (
474 cell.char === ' ' &&
475 cell.styleId === screen.emptyStyleId &&
476 cell.width === CellWidth.Narrow &&
477 !cell.hyperlink
478 )
479}
480// Intern a hyperlink string and return its ID (0 = no hyperlink)
481function internHyperlink(screen: Screen, hyperlink: Hyperlink): number {
482 return screen.hyperlinkPool.intern(hyperlink)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected