binaryage / cljs-oops

ClojureScript macros for convenient native Javascript object access.
Other
351 stars 13 forks source link

Literal dot in key #11

Closed madstap closed 7 years ago

madstap commented 7 years ago

I'm dealing with an api that faux namespace their keys with a dot as the namespace separator; example: {"home-page.main-image": {...}}. cljs-oops thinks dots are nested objects. Is there a workaround for this, or should I just use goog.object with this api?

darwin commented 7 years ago

You would have to escape the dots.

Look here for some inspiration: https://github.com/binaryage/cljs-oops/blob/a78ac41e46a3801c227bdd63192ad8fc978edca6/test/src/tests/oops/main.cljs#L155-L174