We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3d76d22 commit e73d50bCopy full SHA for e73d50b
Sources/ProjectSpec/Project.swift
@@ -194,11 +194,14 @@ extension Project {
194
include = jsonDictionary.json(atKeyPath: "include") ?? []
195
if jsonDictionary["packages"] != nil {
196
packages = try jsonDictionary.json(atKeyPath: "packages", invalidItemBehaviour: .custom({ error in
197
+ guard error.reason == .incorrectType && type(of: error.expectedType.self) == String.Type.self else {
198
+ return .fail
199
+ }
200
var pairs = [(String, Any)]()
201
for item in error.dictionary {
202
pairs.append((
203
item.key as? String ?? "",
- (item.value as? Double).map { String($0) + ".0" } ?? item.value
204
+ (item.value as? Double).map { String($0) } ?? item.value
205
))
206
}
207
return (try? .value(.init(jsonDictionary: .init(uniqueKeysWithValues: pairs)))) ?? .fail
0 commit comments