nodestates

package
v0.0.0-...-cc7149c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

nodestates/nodestates.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNodeExpanded

func IsNodeExpanded(nodeStatesJSON string, index int) (bool, error)

IsNodeExpanded checks if the node at the given index is true (expanded) based on a JSON string representation of node states. The nodeStatesJSON string can be empty (""), which is treated as an empty list of states. If the index is out of bounds for the deserialized states, it returns false.

func ToggleNodeExpanded

func ToggleNodeExpanded(nodeStatesJSON *string, index int) error

ToggleNodeExpanded changes the state of the node at the given index. The nodeStatesJSON is a pointer to a string containing the JSON array of booleans. If the string is empty (""), it's treated as an empty list. If the index is out of bounds, the list of states is automatically expanded with 'false' values up to the required index before toggling. The string pointed to by nodeStatesJSON is updated with the new JSON state.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL