Checks if the node matches a given name.
bool matches(String name) { return name == path || path == "*" || isParameter; }