mirror of
https://github.com/metabolist/metatext.git
synced 2024-06-03 05:59:24 +00:00
18 lines
443 B
Swift
18 lines
443 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
import Mastodon
|
|
|
|
final class ContentDatabaseJSONEncoder: JSONEncoder {
|
|
override init() {
|
|
super.init()
|
|
|
|
let dateFormatter = DateFormatter()
|
|
|
|
dateFormatter.dateFormat = Constants.dateFormat
|
|
dateEncodingStrategy = .formatted(dateFormatter)
|
|
keyEncodingStrategy = .convertToSnakeCase
|
|
outputFormatting = .sortedKeys
|
|
}
|
|
}
|