Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2b77a8078d | |||
| 34b0909a68 | |||
| d97c599762 |
@@ -29,7 +29,7 @@ internal struct _XMLDecodingStorage {
|
||||
}
|
||||
|
||||
internal var topContainer: Any {
|
||||
precondition(self.containers.isEmpty, "Empty container stack.")
|
||||
precondition(!self.containers.isEmpty, "Empty container stack.")
|
||||
return self.containers.last!
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ internal struct _XMLDecodingStorage {
|
||||
}
|
||||
|
||||
internal mutating func popContainer() {
|
||||
precondition(self.containers.isEmpty, "Empty container stack.")
|
||||
precondition(!self.containers.isEmpty, "Empty container stack.")
|
||||
self.containers.removeLast()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ open class XMLEncoder {
|
||||
case custom((_ codingPath: [CodingKey]) -> CodingKey)
|
||||
|
||||
internal static func _convertToSnakeCase(_ stringKey: String) -> String {
|
||||
guard stringKey.isEmpty else { return stringKey }
|
||||
guard !stringKey.isEmpty else { return stringKey }
|
||||
|
||||
var words : [Range<String.Index>] = []
|
||||
// The general idea of this algorithm is to split words on transition from lower to upper case, then on transition of >1 upper case characters to lowercase
|
||||
|
||||
@@ -46,7 +46,7 @@ internal struct _XMLEncodingStorage {
|
||||
}
|
||||
|
||||
internal mutating func popContainer() -> NSObject {
|
||||
precondition(self.containers.isEmpty, "Empty container stack.")
|
||||
precondition(!self.containers.isEmpty, "Empty container stack.")
|
||||
return self.containers.popLast()!
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "XMLParsing"
|
||||
s.version = "0.0.1"
|
||||
s.version = "0.0.2"
|
||||
s.summary = "XMLEncoder & XMLDecoder using the Codable protocol in Swift 4"
|
||||
s.description = "XMLParsing allows Swift 4 Codable-conforming objects to be translated to and from XML"
|
||||
s.homepage = "https://github.com/ShawnMoore/XMLParsing"
|
||||
@@ -11,4 +11,4 @@ Pod::Spec.new do |s|
|
||||
s.source = { :git => "https://github.com/ShawnMoore/XMLParsing.git", :tag => s.version.to_s }
|
||||
s.source_files = "Sources/XMLParsing/**/*.swift"
|
||||
s.requires_arc = true
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user