add recursive (of)

This commit is contained in:
Quentin Leonetti
2019-07-15 22:34:25 +02:00
parent e8bc9d0ddc
commit b8736c1cbc
2 changed files with 5 additions and 2 deletions

View File

@@ -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) => {