mirror of
https://github.com/SagerNet/sing.git
synced 2025-04-04 20:37:40 +03:00
Add common.Top func
This commit is contained in:
parent
f4910823a6
commit
875ad36cc6
1 changed files with 7 additions and 0 deletions
|
@ -22,3 +22,10 @@ func MustCast[T any](obj any) T {
|
|||
}
|
||||
return value
|
||||
}
|
||||
|
||||
func Top(obj any) any {
|
||||
if u, ok := obj.(WithUpstream); ok {
|
||||
return Top(u.Upstream())
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue