Skip to content

Commit ebe6cd9

Browse files
committed
int value
1 parent 34d972a commit ebe6cd9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/NTLBridge/JSONValue.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ public enum JSONValue: Codable, Equatable {
167167
return nil
168168
}
169169

170+
public var intValue: Int? {
171+
if case .number(let value) = self { return Int(value) }
172+
return nil
173+
}
174+
170175
public var boolValue: Bool? {
171176
if case .bool(let value) = self { return value }
172177
return nil

0 commit comments

Comments
 (0)