Changes
2 changed files (+14/-1)
-
-
@@ -118,7 +118,7 @@ return nil} if it.IsCollection() { if c, ok := it.(CollectionInterface); ok { it = FlattenItemCollection(c.Collection()) it = FlattenItemCollection(c.Collection()).Normalize() } } if len(it.GetLink()) > 0 {
-
-
-
@@ -64,6 +64,19 @@ }return i[0] } // Normalize returns the first item if the collection contains only one, // the full collection if the collection contains more than one item, // or nil func (i ItemCollection) Normalize() Item { if len(i) == 0 { return nil } if len(i) == 1 { return i[0] } return i } // Collection returns the current object as collection interface func (i *ItemCollection) Collection() ItemCollection { return *i
-