-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Playlet backend] recommended videos / play next video (#469)
* [Playlet backend] recommended videos / play next video * changelog
- Loading branch information
Showing
4 changed files
with
180 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace ObjectUtils | ||
|
||
function Dig(obj as object, keys as object) as object | ||
for each key in keys | ||
if IsArray(obj) and IsInt(key) and key >= 0 and key < obj.Count() | ||
obj = obj[key] | ||
continue for | ||
end if | ||
|
||
if IsAssociativeArray(obj) and obj.DoesExist(key) | ||
obj = obj[key] | ||
continue for | ||
end if | ||
|
||
return invalid | ||
end for | ||
|
||
return obj | ||
end function | ||
|
||
end namespace |