From e0ac8e692a5d1dd49dffbfe4ebccd1337f2894aa Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Tue, 2 May 2023 06:56:03 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20Remove:=20Temp=20`Encod?= =?UTF-8?q?able+Helpers`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Temp/Extensions/Encodable+Helpers.swift | 39 ------------------- 1 file changed, 39 deletions(-) delete mode 100644 ios/src_library/Temp/Extensions/Encodable+Helpers.swift diff --git a/ios/src_library/Temp/Extensions/Encodable+Helpers.swift b/ios/src_library/Temp/Extensions/Encodable+Helpers.swift deleted file mode 100644 index 5ef594e8..00000000 --- a/ios/src_library/Temp/Extensions/Encodable+Helpers.swift +++ /dev/null @@ -1,39 +0,0 @@ -// -// Encodable+Helpers.swift -// nativeUIModulesTest -// -// Created by Dominic Go on 7/6/20. -// - -import Foundation - -internal struct JSON { - static let encoder = JSONEncoder(); -}; - -internal extension Encodable { - subscript(key: String) -> Any? { - return dictionary[key]; - }; - - var dictionary: [String: Any] { - return - (try? JSONSerialization.jsonObject(with: JSON.encoder.encode(self))) - as? [String: Any] ?? [:]; - }; - - func jsonData() throws -> Data { - let encoder = JSON.encoder; - - encoder.outputFormatting = .prettyPrinted; - - if #available(iOS 10.0, *) { - encoder.dateEncodingStrategy = .iso8601; - - } else { - encoder.dateEncodingStrategy = .millisecondsSince1970; - }; - - return try encoder.encode(self); - }; -};