From 74a6cea7e6c95bad51c35781c8bb6988e7670f54 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Wed, 24 Jun 2020 12:48:40 +0200 Subject: [PATCH] [#120] Update `freezable?` to cover `nil` --- src/taoensso/nippy/utils.clj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/taoensso/nippy/utils.clj b/src/taoensso/nippy/utils.clj index 2e00cabc..95014f17 100644 --- a/src/taoensso/nippy/utils.clj +++ b/src/taoensso/nippy/utils.clj @@ -93,6 +93,9 @@ test for pre/post serialization value equality (there's no good general way of doing so)." + ;; TODO Not happy with this approach in general, could do with a refactor. + ;; Maybe return true/false/nil (nil => maybe)? + ([x] (freezable? x nil)) ([x {:keys [allow-clojure-reader? allow-java-serializable?]}] (if (is-coll? x) @@ -102,6 +105,7 @@ (is? x java.lang.String) (is? x java.lang.Long) (is? x java.lang.Double) + (nil? x) (is? x clojure.lang.BigInt) (is? x clojure.lang.Ratio)