Skip to content

Commit e790b50

Browse files
committed
Added types object and array.
1 parent bc6ef72 commit e790b50

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/jason.ex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,15 @@ defmodule Jason do
2525
@typedoc "Available decoding options."
2626
@type decode_opt :: {:keys, keys} | {:strings, strings} | {:floats, floats} | {:objects, objects}
2727

28-
@typedoc "A plain JSON value where map keys can only be strings."
29-
@type value :: nil | String.t() | number | boolean | [value] | %{String.t() => value}
28+
@typedoc "A plain JSON object where keys can only be strings."
29+
@type object :: %{String.t() => value}
30+
@typedoc "A plain JSON array."
31+
@type array :: [value]
32+
@typedoc "A plain JSON value."
33+
@type value :: nil | String.t() | number | boolean | array | object
3034
@typedoc "A decoded JSON value where map keys can have any type."
3135
@type decoded :: [decoded] | %{map_key => decoded} | value
32-
@typedoc "The map key types that can be encoded."
36+
@typedoc "The type of map keys that can be encoded."
3337
@type encodable_key :: String.t() | number | atom | [encodable_key]
3438
@typedoc "The types that can be encoded. Not included are: `tuple`s, `function`s, `reference`s, `port`s and `pid`s."
3539
@type encodable :: String.t() | number | atom | [encodable] | %{encodable_key => encodable}

0 commit comments

Comments
 (0)