isPrefixOf method

bool isPrefixOf(
  1. TomlKey child
)

Tests whether the parts of the given key start with all parts of this key.

Implementation

bool isPrefixOf(TomlKey child) {
  if (child.parts.length < parts.length) return false;
  for (var i = 0; i < parts.length; i++) {
    if (parts[i] != child.parts[i]) return false;
  }
  return true;
}