File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Sources/AblyLiveObjects/Public Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,22 @@ public enum LiveMapValue: Sendable, Equatable {
143143 return nil
144144 }
145145
146+ /// If this `LiveMapValue` has case `jsonArray`, this returns the associated value. Else, it returns `nil`.
147+ public var jsonArrayValue : [ JSONValue ] ? {
148+ if case let . jsonArray( value) = self {
149+ return value
150+ }
151+ return nil
152+ }
153+
154+ /// If this `LiveMapValue` has case `jsonObject`, this returns the associated value. Else, it returns `nil`.
155+ public var jsonObjectValue : [ String : JSONValue ] ? {
156+ if case let . jsonObject( value) = self {
157+ return value
158+ }
159+ return nil
160+ }
161+
146162 // MARK: - Equatable Implementation
147163
148164 public static func == ( lhs: LiveMapValue , rhs: LiveMapValue ) -> Bool {
You can’t perform that action at this time.
0 commit comments