all repos — grayfriday @ d96905437ea043766135ee4c5cd4d32366547288

blackfriday fork with a few changes

Add Node.IsLeaf
Tom Payne twpayne@gmail.com
Tue, 23 Apr 2019 22:12:31 +0200
commit

d96905437ea043766135ee4c5cd4d32366547288

parent

b98aa06008196b3fd3c561305a871978113be869

1 files changed, 5 insertions(+), 0 deletions(-)

jump to
M node.gonode.go

@@ -239,6 +239,11 @@ return false

} } +// IsLeaf returns true if 'n' is a leaf node. +func (n *Node) IsLeaf() bool { + return !n.IsContainer() +} + func (n *Node) canContain(t NodeType) bool { if n.Type == List { return t == Item