|
|
@@ -1,5 +1,5 @@
|
|
|
//
|
|
|
-// URLHintArray.swift
|
|
|
+// CodableArray.swift
|
|
|
// Todos
|
|
|
//
|
|
|
// Created by Sam Jaffe on 3/1/26.
|
|
|
@@ -11,6 +11,7 @@ internal import Combine
|
|
|
|
|
|
typealias CodableArray<A: Codable> = [A]
|
|
|
|
|
|
+// swiftlint:disable line_length
|
|
|
/**
|
|
|
* @brief Provides a UserDefaults-compatibiliy layer for Array<URLHint> that
|
|
|
* allows seamless reading/writing on program startup and changes.
|
|
|
@@ -24,6 +25,7 @@ typealias CodableArray<A: Codable> = [A]
|
|
|
* comply w/ RawRepresentable in the future
|
|
|
*/
|
|
|
extension CodableArray: @retroactive RawRepresentable {
|
|
|
+ // swiftlint:enable line_length
|
|
|
public init?(rawValue: String) {
|
|
|
guard let data = rawValue.data(using: .utf8),
|
|
|
let result = try? JSONDecoder().decode(CodableArray.self, from: data)
|