Skip to content

Commit 0f5818c

Browse files
committed
strMap -> foreignObject
1 parent 67c469d commit 0f5818c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/Data/Codec/Argonaut/Common.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ map codecA = dimap M.toUnfoldable M.fromFoldable <<< array <<< tuple codecA
8080
-- | A codec for `StrMap` values.
8181
-- |
8282
-- | Encodes as an array of two-element key/value arrays in JSON.
83-
strMap a. JsonCodec a JsonCodec (FO.Object a)
84-
strMap = dimap FO.toUnfoldable FO.fromFoldable <<< array <<< tuple string
83+
foreignObject a. JsonCodec a JsonCodec (FO.Object a)
84+
foreignObject = dimap FO.toUnfoldable FO.fromFoldable <<< array <<< tuple string

src/Data/Codec/Argonaut/Compat.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ maybe codec = basicCodec dec enc
4242
-- | Encodes as a JSON object with the keys as properties.
4343
-- |
4444
-- | ```purescript
45-
-- | encode (strMap int) (Foreign.Object.fromFoldable [Tuple "a" 1, Tuple "b" 2]) == "{ \"a\": 1, \"b\": 2}"
45+
-- | encode (foreignObject int) (Foreign.Object.fromFoldable [Tuple "a" 1, Tuple "b" 2]) == "{ \"a\": 1, \"b\": 2}"
4646
-- | ```
47-
strMap a. JsonCodec a JsonCodec (FO.Object a)
48-
strMap codec =
47+
foreignObject a. JsonCodec a JsonCodec (FO.Object a)
48+
foreignObject codec =
4949
mapCodec
5050
(BF.lmap (Named "StrMap") <<< F.map fromArray <<< traverse decodeItem <<< FO.toUnfoldable)
5151
(F.map (encode codec))

test/Test/Common.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ propStrMapCodec ∷ Gen Result
5959
propStrMapCodec =
6060
propCodec
6161
(genForeignObject genAsciiString genInt)
62-
(JA.strMap JA.int)
62+
(JA.foreignObject JA.int)

test/Test/Compat.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,19 @@ propStrMapCodec ∷ Gen Result
5757
propStrMapCodec =
5858
propCodec
5959
(genForeignObject genAsciiString genInt)
60-
(JA.strMap JA.int)
60+
(JA.foreignObject JA.int)
6161

6262
propStrMapCodecEncodeCompat Gen Result
6363
propStrMapCodecEncodeCompat =
6464
propCodecEncodeCompat
6565
(genForeignObject genAsciiString genInt)
66-
(JA.strMap JA.int)
66+
(JA.foreignObject JA.int)
6767

6868
propStrMapCodecDecodeCompat Gen Result
6969
propStrMapCodecDecodeCompat =
7070
propCodecDecodeCompat
7171
(genForeignObject genAsciiString genInt)
72-
(JA.strMap JA.int)
72+
(JA.foreignObject JA.int)
7373

7474
propCodecEncodeCompat a. Eq a Show a DecodeJson a Gen a JA.JsonCodec a Gen Result
7575
propCodecEncodeCompat gen codec = do

0 commit comments

Comments
 (0)