File tree Expand file tree Collapse file tree 2 files changed +4
-15
lines changed
FirebaseFunctions/Sources Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -440,16 +440,12 @@ enum FunctionsConstants {
440
440
cachePolicy: . useProtocolCachePolicy,
441
441
timeoutInterval: timeout)
442
442
let fetcher = fetcherService. fetcher ( with: request)
443
- let body = NSMutableDictionary ( )
444
443
445
444
// Encode the data in the body.
446
- var localData = data
447
- if data == nil {
448
- localData = NSNull ( )
449
- }
445
+ let data = data ?? NSNull ( )
450
446
// Force unwrap to match the old invalid argument thrown.
451
- let encoded = try ! serializer. encode ( localData! )
452
- body [ " data " ] = encoded
447
+ let encoded = try ! serializer. encode ( data )
448
+ let body = [ " data " : encoded]
453
449
454
450
do {
455
451
let payload = try JSONSerialization . data ( withJSONObject: body)
Original file line number Diff line number Diff line change @@ -28,14 +28,7 @@ extension FunctionsSerializer {
28
28
}
29
29
}
30
30
31
- class FunctionsSerializer : NSObject {
32
- private let dateFormatter : DateFormatter = {
33
- let formatter = DateFormatter ( )
34
- formatter. dateFormat = " yyyy-MM-dd'T'HH:mm:ss.SSS'Z' "
35
- formatter. timeZone = TimeZone ( identifier: " UTC " )
36
- return formatter
37
- } ( )
38
-
31
+ final class FunctionsSerializer {
39
32
// MARK: - Internal APIs
40
33
41
34
func encode( _ object: Any ) throws -> AnyObject {
You can’t perform that action at this time.
0 commit comments