Skip to content

Commit

Permalink
fix bag in json printer. printed true and false when number equal 1 a…
Browse files Browse the repository at this point in the history
…nd 0 respectively
  • Loading branch information
Abdula Magomedov committed Aug 24, 2021
1 parent 7268fd1 commit 6ad687f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Pulse/Sources/PulseUI/Services/JSONPrinter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@ final class JSONPrinter {
}
append("]", .punctuation)
}
case let object as Bool:
append(object ? "true" : "false", .valueOther)
case let number as NSNumber:
if number === kCFBooleanTrue {
append("true", .valueOther)
} else if number === kCFBooleanFalse {
append("false", .valueOther)
} else {
append("\(number)", .valueOther)
}
default:
if json is NSNull {
append("null", .null)
Expand Down

0 comments on commit 6ad687f

Please sign in to comment.