Clojurians
#cljs-dev
<
2017-09-18
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

richiardiandrea19:09:42

Hello folks, I was checking js->clj on an object that is not really an object (from AWS Gateway query params)

richiardiandrea19:09:18

so (type my-obj) returns nil so (identical? (type x) js/Object) fails and the object is not converted

richiardiandrea19:09:50

however, (goog/typeOf my-obj) works fine and returns object

richiardiandrea19:09:04

my question would be, should we add a check using goog/typeOf in js->clj for completeness?

darwin19:09:27

@richiardiandrea hm, have you tried to extend IEncodeClojure on that weird object?

darwin19:09:38

IMO js->clj is a can of worms and nobody could possibly touch it because that would break others' people code

richiardiandrea19:09:38

@darwin I haven't no, but it would probably work as workaround, it still feels there I should not be doing that, it should be supported OOTB. Probably there are reasons behind using type only

richiardiandrea19:09:02

Would like to know which ones, for awareness of JS weirdnesses :smile:

richiardiandrea19:09:24

let me know if a JIRA is necessary or I am completely on the wrong path here :wink: