From c5e907ebdd72ea0453dfc2c73eae797cf0a39d52 Mon Sep 17 00:00:00 2001 From: Derrick Hathaway Date: Wed, 14 Dec 2016 15:48:18 -0700 Subject: [PATCH] Add <| operators for JSONObject? and [JSONObject]? --- Sources/Operators.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/Operators.swift b/Sources/Operators.swift index f2a4b75..d7232b3 100644 --- a/Sources/Operators.swift +++ b/Sources/Operators.swift @@ -49,6 +49,12 @@ public func <| (dictionary: MarshaledObject, key: String) t public func <| (dictionary: MarshaledObject, key: String) throws -> JSONObject { return try dictionary.value(for: key) } +public func <| (dictionary: MarshaledObject, key: String) throws -> JSONObject? { + return try dictionary.value(for: key) +} public func <| (dictionary: MarshaledObject, key: String) throws -> [JSONObject] { return try dictionary.value(for: key) } +public func <| (dictionary: MarshaledObject, key: String) throws -> [JSONObject]? { + return try dictionary.value(for: key) +}