Improved the platform initializer at the Amiibo+Platform extension in the library target.
This commit is contained in:
@@ -47,30 +47,18 @@ extension Amiibo {
|
|||||||
_ threeDS: [Components.Schemas.AmiiboGame]?,
|
_ threeDS: [Components.Schemas.AmiiboGame]?,
|
||||||
_ wiiU: [Components.Schemas.AmiiboGame]?
|
_ wiiU: [Components.Schemas.AmiiboGame]?
|
||||||
) {
|
) {
|
||||||
guard (`switch` != nil && `switch`?.isEmpty == false)
|
guard `switch`?.isEmpty == false
|
||||||
|| (switch2 != nil && switch2?.isEmpty == false)
|
|| switch2?.isEmpty == false
|
||||||
|| (threeDS != nil && threeDS?.isEmpty == false)
|
|| threeDS?.isEmpty == false
|
||||||
|| (wiiU != nil && wiiU?.isEmpty == false)
|
|| wiiU?.isEmpty == false
|
||||||
else {
|
else {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
self.switch = {
|
self.switch = `switch`?.map { .init($0) } ?? []
|
||||||
guard let `switch` else { return [] }
|
self.switch2 = switch2?.map { .init($0) } ?? []
|
||||||
return `switch`.map { .init($0) }
|
self.threeDS = threeDS?.map { .init($0) } ?? []
|
||||||
}()
|
self.wiiU = wiiU?.map { .init($0) } ?? []
|
||||||
self.switch2 = {
|
|
||||||
guard let switch2 else { return [] }
|
|
||||||
return switch2.map { .init($0) }
|
|
||||||
}()
|
|
||||||
self.threeDS = {
|
|
||||||
guard let threeDS else { return [] }
|
|
||||||
return threeDS.map { .init($0) }
|
|
||||||
}()
|
|
||||||
self.wiiU = {
|
|
||||||
guard let wiiU else { return [] }
|
|
||||||
return wiiU.map { .init($0) }
|
|
||||||
}()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user