generated from tpl/purs
fix: serializable url
This commit is contained in:
parent
939f6d1dcd
commit
1f4995a2d1
6405
spago.lock
6405
spago.lock
File diff suppressed because it is too large
Load Diff
@ -17,6 +17,7 @@ package:
|
||||
- maybe
|
||||
- node-event-emitter
|
||||
- node-streams
|
||||
- node-url
|
||||
- nullable
|
||||
- ordered-collections
|
||||
- prelude
|
||||
@ -27,5 +28,4 @@ package:
|
||||
workspace:
|
||||
extra_packages: {}
|
||||
package_set:
|
||||
url: https://raw.githubusercontent.com/purescript/package-sets/psc-0.15.10-20230930/packages.json
|
||||
hash: sha256-nTsd44o7/hrTdk0c6dh0wyBqhFFDJJIeKdQU6L1zv/A=
|
||||
registry: 47.7.1
|
||||
|
@ -15,6 +15,7 @@ import Foreign (Foreign, readArray, readBoolean, readInt, readNullOrUndefined, r
|
||||
import Foreign.Index (readProp)
|
||||
import Foreign.Object (Object)
|
||||
import JS.BigInt (BigInt)
|
||||
import Node.URL (URL)
|
||||
import Prim.Row as Row
|
||||
import Prim.RowList (class RowToList, Cons, Nil, RowList)
|
||||
import Record (get)
|
||||
@ -36,6 +37,10 @@ instance Serializable String where
|
||||
serialize = unsafeToForeign
|
||||
deserialize = lmap show <<< runExcept <<< readString
|
||||
|
||||
instance Serializable URL where
|
||||
serialize = unsafeToForeign
|
||||
deserialize = lmap show <<< runExcept <<< unsafeReadTagged "URL"
|
||||
|
||||
instance Serializable Int where
|
||||
serialize = unsafeToForeign
|
||||
deserialize = lmap show <<< runExcept <<< readInt
|
||||
|
Loading…
Reference in New Issue
Block a user