We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24a9157 commit 0a6cb16Copy full SHA for 0a6cb16
1 file changed
Sources/RBBJSON/IO/JSON+File.swift
@@ -14,6 +14,9 @@ public extension JSON {
14
15
try FileManager.default.createDirectory(at: url.deletingLastPathComponent(), withIntermediateDirectories: true)
16
17
- try JSONEncoder().encode(json).write(to: url)
+ var encoder = JSONEncoder()
18
+ encoder.outputFormatting = [.sortedKeys, .prettyPrinted, .withoutEscapingSlashes]
19
+
20
+ try encoder.encode(json).write(to: url)
21
}
22
0 commit comments