File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 30
30
"purescript-maybe" : " ^2.0.1" ,
31
31
"purescript-unsafe-coerce" : " ^2.0.0" ,
32
32
"purescript-bifunctors" : " ^2.0.0" ,
33
- "purescript-refs" : " ^2.0.0"
33
+ "purescript-refs" : " ^2.0.0" ,
34
+ "purescript-foreign" : " ^3.0.1"
34
35
},
35
36
"devDependencies" : {
36
37
"purescript-psci-support" : " ^2.0.0" ,
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import Control.Monad.Eff.Ref as Ref
16
16
import Data.Maybe (Maybe (..), maybe )
17
17
import Data.StrMap as StrMap
18
18
import Data.Nullable (toNullable )
19
+ import Data.Foreign (typeOf )
19
20
import Data.Function.Uncurried as Fn
20
21
import Data.Tuple (Tuple (..), fst , snd )
21
22
import DOM (DOM )
@@ -190,4 +191,6 @@ unsafeGetProperty = Util.unsafeGetAny
190
191
191
192
removeProperty ∷ ∀ eff . Fn.Fn2 String DOM.Element (Eff (dom ∷ DOM | eff ) Unit )
192
193
removeProperty = Fn .mkFn2 \key el →
193
- Fn .runFn3 Util .unsafeSetAny key Util .jsUndefined el
194
+ case typeOf (Fn .runFn2 Util .unsafeGetAny key el) of
195
+ " string" → Fn .runFn3 Util .unsafeSetAny key " " el
196
+ _ → Fn .runFn3 Util .unsafeSetAny key Util .jsUndefined el
You can’t perform that action at this time.
0 commit comments