Skip to content

Commit d6a45d1

Browse files
committed
bugFix
1 parent 64222c2 commit d6a45d1

4 files changed

Lines changed: 9 additions & 17 deletions

File tree

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ PODS:
88
- FBSnapshotTestCase/SwiftSupport (2.1.4):
99
- FBSnapshotTestCase/Core
1010
- HandyJSON (5.0.0-beta.1)
11-
- SmartCodable/Core (5.1.0)
12-
- SmartCodable/Inherit (5.1.0):
11+
- SmartCodable/Core (5.1.1)
12+
- SmartCodable/Inherit (5.1.1):
1313
- SmartCodable/Core
1414
- SnapKit (5.6.0)
1515

@@ -41,7 +41,7 @@ SPEC CHECKSUMS:
4141
CleanJSON: 910a36465ce4829e264a902ccf6d1455fdd9f980
4242
FBSnapshotTestCase: 094f9f314decbabe373b87cc339bea235a63e07a
4343
HandyJSON: 582477127ab3ab65bd2e471815f1a7b846856978
44-
SmartCodable: 681e8871575e2ee119b7cbead914a39bc1f28ab2
44+
SmartCodable: 4592eeb1e7921e96c91372df59e7260f963a8dbc
4545
SnapKit: e01d52ebb8ddbc333eefe2132acf85c8227d9c25
4646

4747
PODFILE CHECKSUM: fbd909bd1bf3747400cd705163fad38954f6a18f

Example/SmartCodable/Test3ViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ class Test3ViewController: BaseViewController {
1515
"age": 200
1616
]
1717

18-
guard let model = Model.deserialize(from: dict) else { return }
18+
guard let model = [Model].deserialize(from: [dict, dict]) else { return }
1919
print(model)
2020
}
2121

2222
struct Model: SmartCodable {
23-
@SmartIgnored
24-
var name: Any?
23+
24+
var name: String?
2525
}
2626
}
2727

SmartCodable.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
Pod::Spec.new do |s|
1414
s.name = 'SmartCodable'
15-
s.version = '5.1.0'
15+
s.version = '5.1.1'
1616
s.summary = 'Swift数据解析库'
1717

1818
s.homepage = 'https://github.com/iAmMccc/SmartCodable'

Sources/SmartCodable/Core/SmartCodable/SmartDecodable.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,8 @@ fileprivate func _deserializeArray<T>(input: Any, type: [T].Type, options: Set<S
247247
do {
248248
let _decoder = createDecoder(type: type, options: options)
249249

250-
251-
if options?.isEmpty ?? false {
252-
let obj = try _decoder.smartDecode(type, from: input)
253-
return obj
254-
255-
} else {
256-
let obj = try _decoder.decode(type, from: input as! Data)
257-
return obj
258-
259-
}
250+
let obj = try _decoder.smartDecode(type, from: input)
251+
return obj
260252

261253
} catch {
262254
return nil

0 commit comments

Comments
 (0)