cognitect/transit-cljs

Byte arrays -> Uint8Array and comparability

Closed this issue · 1 comments

When encoding a byte array with transit-clj, and then decoding it with transit-cljs, a Uint8Array type is used. This breaks several things, i.e. such data structures cannot be compared:

  • using = (can get around that with extend-type, use array-seq in there)
  • using set/difference (can't get around that, as it uses identical?).

(One possible solution would be to provide custom handler for "b", but it is currently prohibited in transit.impl.decoder in transit-js library - the "Cannot override handler for ground type "b")" exception is being thrown.)

You cannot compare primitive arrays in Java / Clojure either.