typed.go
func (t Typed) ObjectsIf(key string) ([]Typed, bool) {
	value, exists := t[key]
	if exists == true {
		switch t := value.(type) {
		case []interface{}:
			l := len(t)
			n := make([]Typed, l)
			for i := 0; i < l; i++ {
				switch it := t[i].(type) {
				case map[string]interface{}:
					n[i] = Typed(it)
				case Typed:
					n[i] = it
				}
			}
			return n, true
		case []map[string]interface{}:
			l := len(t)
			n := make([]Typed, l)
			for i := 0; i < l; i++ {
				n[i] = Typed(t[i])
			}
			return n, true
		case []Typed:
			return t, true
		}
	}
	return nil, false
}
func (t Typed) ObjectsIf(key string) ([]Typed, bool) {
	value, exists := t[key]
	if exists == true {
		switch t := value.(type) {
		case []interface{}:
			l := len(t)
			n := make([]Typed, l)
			for i := 0; i < l; i++ {
				switch it := t[i].(type) {
				case map[string]interface{}:
					n[i] = Typed(it)
				case Typed:
					n[i] = it
				}
			}
			return n, true
		case []map[string]interface{}:
			l := len(t)
			n := make([]Typed, l)
			for i := 0; i < l; i++ {
				n[i] = Typed(t[i])
			}
			return n, true
		case []Typed:
			return t, true
		}
	}
	return nil, false
}
func ( t Typed ) ObjectsIf ( key string ) ( [ ] Typed , bool ) { value , exists := t [ key ] if exists == true { switch t := value . ( type ) { case [ ] interface { } : l := len ( t ) n := make ( [ ] Typed , l ) for i := 0 ; i < l ; i ++ { switch it := t [ i ] . ( type ) { case map [ string ] interface { } : n [ i ] = Typed ( it ) case Typed : n [ i ] = it } } return n , true case [ ] map [ string ] interface { } : l := len ( t ) n := make ( [ ] Typed , l ) for i := 0 ; i < l ; i ++ { n [ i ] = Typed ( t [ i ] ) } return n , true case [ ] Typed : return t , true } } return nil , false }
// Returns a slice of Typed helpers and true if exists, otherwise; nil and false.
Returns a slice of Typed helpers and true if exists otherwise ; nil and false .