isValidPathHash static method

bool isValidPathHash(
  1. String pathHash
)

Validates if a path hash follows the correct hierarchical format

Implementation

static bool isValidPathHash(String pathHash) {
  if (pathHash.isEmpty) return false;

  final parts = pathHash.split('.');
  for (final part in parts) {
    if (part.isEmpty || int.tryParse(part) == null || int.parse(part) < 1) {
      return false;
    }
  }
  return true;
}