Skip to content

Commit

Permalink
AK: Add JsonObjectSerializer::add(key, bool) overload
Browse files Browse the repository at this point in the history
Without this, bools will get implicitly converted to integers, which is
usually not what we want.
  • Loading branch information
awesomekling committed Feb 8, 2020
1 parent f91b3aa commit 745ea2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions AK/JsonObjectSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ class JsonObjectSerializer {
m_builder.append('"');
}

void add(const StringView& key, bool value)
{
begin_item(key);
m_builder.append(value ? "true" : "false");
}

void add(const StringView& key, i32 value)
{
begin_item(key);
Expand Down

0 comments on commit 745ea2a

Please sign in to comment.