add recursive (of)
This commit is contained in:
parent
e8bc9d0ddc
commit
b8736c1cbc
@ -184,8 +184,10 @@ function Library (ronin) {
|
||||
|
||||
//
|
||||
|
||||
this.of = (h, k) => {
|
||||
return h[k]
|
||||
this.of = (h, ...keys) => {
|
||||
return keys.reduce((acc, key) => {
|
||||
return acc[key]
|
||||
}, h)
|
||||
}
|
||||
|
||||
this.theme = (variable, el = document.documentElement) => {
|
||||
|
@ -57,4 +57,5 @@
|
||||
|
||||
; Interop
|
||||
(test "interop" ((of (of js "Math") "max") 2 4) 4)
|
||||
(test "recursive key selector" ((of js "Math" "max") 2 4) 4)
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user