summaryrefslogtreecommitdiff
path: root/lib/json/pure/generator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/json/pure/generator.rb')
-rw-r--r--lib/json/pure/generator.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/json/pure/generator.rb b/lib/json/pure/generator.rb
index ef1c2e8..2257ee3 100644
--- a/lib/json/pure/generator.rb
+++ b/lib/json/pure/generator.rb
@@ -332,8 +332,10 @@ module JSON
first = false
}
depth = state.depth -= 1
- result << state.object_nl
- result << state.indent * depth if indent
+ unless first
+ result << state.object_nl
+ result << state.indent * depth if indent
+ end
result << '}'
result
end