Merge pull request #548 from lightpanda-io/namednodemap_indexed_get

add indexed_get to namednodemap
This commit is contained in:
Pierre Tachoire
2025-04-22 09:13:05 +02:00
committed by GitHub

View File

@@ -70,6 +70,13 @@ pub const NamedNodeMap = struct {
) !*parser.Attribute {
return try parser.namedNodeMapRemoveNamedItemNS(self, namespace, localname);
}
pub fn indexed_get(self: *parser.NamedNodeMap, index: u32, has_value: *bool) !*parser.Attribute {
return (try NamedNodeMap._item(self, index)) orelse {
has_value.* = false;
return undefined;
};
}
};
// Tests