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 3030 "purescript-maybe" : " ^2.0.1" ,
3131 "purescript-unsafe-coerce" : " ^2.0.0" ,
3232 "purescript-bifunctors" : " ^2.0.0" ,
33- "purescript-refs" : " ^2.0.0"
33+ "purescript-refs" : " ^2.0.0" ,
34+ "purescript-foreign" : " ^3.0.1"
3435 },
3536 "devDependencies" : {
3637 "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
1616import Data.Maybe (Maybe (..), maybe )
1717import Data.StrMap as StrMap
1818import Data.Nullable (toNullable )
19+ import Data.Foreign (typeOf )
1920import Data.Function.Uncurried as Fn
2021import Data.Tuple (Tuple (..), fst , snd )
2122import DOM (DOM )
@@ -190,4 +191,6 @@ unsafeGetProperty = Util.unsafeGetAny
190191
191192removeProperty ∷ ∀ eff . Fn.Fn2 String DOM.Element (Eff (dom ∷ DOM | eff ) Unit )
192193removeProperty = 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