Allow CollectionPath.Of on IRIs
This commit is contained in:
parent
1ffdb48e69
commit
3f5197d77b
5
typer.go
5
typer.go
|
@ -106,9 +106,12 @@ func (t CollectionPath) IRI(i Item) IRI {
|
|||
|
||||
// Of gives us the property of the i Item that corresponds to the t CollectionPath type.
|
||||
func (t CollectionPath) Of(i Item) Item {
|
||||
if IsNil(i) || !i.IsObject() {
|
||||
if IsNil(i) {
|
||||
return nil
|
||||
}
|
||||
if IsIRI(i) {
|
||||
return i.GetLink().AddPath(string(t))
|
||||
}
|
||||
var it Item
|
||||
if OfActor.Contains(t) && ActorTypes.Contains(i.GetType()) {
|
||||
OnActor(i, func(a *Actor) error {
|
||||
|
|
Reference in a new issue