Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit a8b6fae

Browse files
committed
Lower minimum OS requirements
1 parent 79344b8 commit a8b6fae

4 files changed

Lines changed: 14 additions & 30 deletions

File tree

.swiftpm/xcode/xcuserdata/charlie.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
<key>isShown</key>
1515
<false/>
1616
<key>orderHint</key>
17-
<integer>3</integer>
17+
<integer>2</integer>
1818
</dict>
1919
<key>Tutorial (Playground) 2.xcscheme</key>
2020
<dict>
2121
<key>isShown</key>
2222
<false/>
2323
<key>orderHint</key>
24-
<integer>4</integer>
24+
<integer>3</integer>
2525
</dict>
2626
<key>Tutorial (Playground) 3.xcscheme</key>
2727
<dict>
2828
<key>isShown</key>
2929
<false/>
3030
<key>orderHint</key>
31-
<integer>1</integer>
31+
<integer>4</integer>
3232
</dict>
3333
<key>Tutorial (Playground) 4.xcscheme</key>
3434
<dict>
@@ -49,7 +49,7 @@
4949
<key>isShown</key>
5050
<false/>
5151
<key>orderHint</key>
52-
<integer>2</integer>
52+
<integer>1</integer>
5353
</dict>
5454
</dict>
5555
<key>SuppressBuildableAutocreation</key>

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
// swift-tools-version:5.5
1+
// swift-tools-version:5.0
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription
55

66
let package = Package(
77
name: "MonadicJSON",
88
platforms: [
9-
.macOS(.v12), .iOS(.v15), .watchOS(.v8), .tvOS(.v15),
9+
.macOS(.v10_10), .iOS(.v8), .watchOS(.v2), .tvOS(.v9),
1010
],
1111
products: [
1212
// Products define the executables and libraries produced by a package, and make them visible to other packages.

Sources/MonadicJSON/JSON.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ extension Null: Codable {
3535
}
3636
}
3737

38+
public struct JSONDecimalError: Error {
39+
}
40+
3841
public indirect enum JSON: Hashable, Codable {
3942
case null
4043
case string(String)
@@ -43,15 +46,18 @@ public indirect enum JSON: Hashable, Codable {
4346
case object([String: JSON])
4447
case array([JSON])
4548

46-
public func encodable() throws -> some Encodable {
49+
public func encodable() throws -> Encodable {
4750
func recurse(json: JSON) throws -> AnyEncodable {
4851
switch json {
4952
case let .object(value):
5053
return try .init(value.mapValues(recurse))
5154
case let .array(value):
5255
return try .init(value.map(recurse))
5356
case let .number(value):
54-
return try .init(Decimal(value, format: .number))
57+
guard let decimal = Decimal(string: value) else {
58+
throw JSONDecimalError()
59+
}
60+
return .init(decimal)
5561
case let .string(value):
5662
return .init(value)
5763
case let .bool(value):

Tests/Info.plist

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)