Skip to content

PMJSON v3.1.0

Compare
Choose a tag to compare
@lilyball lilyball released this 26 Feb 07:35
· 30 commits to master since this release
  • Improve .pretty output for empty arrays/dictionaries.
  • Speed up JSON.encodeAsData() pretty significantly. It's now very nearly as fast as JSON.encodeAsString().
  • Speed up JSON.Encoder.encodeAsString() and JSON.Encoder.encodeAsData().
  • Add a couple of convenience static methods to JSON that mimic the enum cases: JSON.int(_:) and JSON.cgFloat(_:). These can be used when JSON(_:) triggers too much type complexity. Also add a JSON(_:) override for CGFloat.
  • Add JSON.Encoder.keyEncodingStrategy. This is very similar to Swift 4.1's JSONEncoder.keyEncodingStrategy, although by default it won't apply to any nested values of type JSON or JSONObject (there's another option applyKeyEncodingStrategyToJSONObject that controls this).
  • Add JSON.Decoder.keyDecodingStrategy. This is very similar to Swift 4.1's JSONDecoder.keyDecodingStrategy, although by default it won't apply to decoding any values of type JSON or JSONObject (there's another option applyKeyDecodingStrategyToJSONObject that controls this).
  • Add JSON.Encoder.dateEncodingStrategy. This is very similar to JSONEncoder.dateEncodingStrategy except it includes another case for encoding ISO8601-formatted dates with fractional seconds (on Apple platforms).
  • Add JSON.Decoder.dateDecodingStrategy. This is very similar to JSONDecoder.dateDecodingStrategy except it includes another case for decoding ISO8601-formatted dates with fractional seconds (on Apple platforms).
  • Add JSON.Encoder.dataEncodingStrategy. This is identical to JSONEncoder.dataEncodingStrategy.
  • Add JSON.Decoder.dataDecodingStrategy. This is identical to JSONDecoder.dataDecodingStrategy.