Skip to content

Commit

Permalink
Update JsonMapper.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark authored Nov 13, 2020
1 parent 06b304a commit d25ae74
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/JsonMapper/JsonMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public enum JSONElement: Codable, Equatable, Hashable {
public subscript(keyPath path: String) -> JSONElement {
var current = self
for key in path.split(separator: ".") {
switch self {
switch current {
case .null:
return .null
case .object(let value):
Expand Down Expand Up @@ -311,7 +311,7 @@ public struct JSONMapper {

public subscript(keyPath path: String) -> JSONMapper {
var current = self
for key in path.split(separator: ",") {
for key in path.split(separator: ".") {
guard let v = current.originData else {
return JSONMapper(raw: nil)
}
Expand Down

0 comments on commit d25ae74

Please sign in to comment.