Skip to content

Commit e4cbb36

Browse files
committed
fix: typo in CBOROptions parameter: shouldShortMapKeysshouldSortMapKeys
The parameter name in `CBOROptions.init()` was incorrectly spelled as `shouldShortMapKeys` when it should be `shouldSortMapKeys` to match the property name and convey the correct meaning (sorting keys, not shortening them).
1 parent 12757c5 commit e4cbb36

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/CBOROptions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ public struct CBOROptions {
1212
dateStrategy: DateStrategy = .taggedAsEpochTimestamp,
1313
forbidNonStringMapKeys: Bool = false,
1414
maximumDepth: Int = .max,
15-
shouldShortMapKeys: Bool = true
15+
shouldSortMapKeys: Bool = true
1616
) {
1717
self.useStringKeys = useStringKeys
1818
self.dateStrategy = dateStrategy
1919
self.forbidNonStringMapKeys = forbidNonStringMapKeys
2020
self.maximumDepth = maximumDepth
21-
self.shouldSortMapKeys = shouldShortMapKeys
21+
self.shouldSortMapKeys = shouldSortMapKeys
2222
}
2323

2424
func toCodableEncoderOptions() -> CodableCBOREncoder._Options {

Tests/CBOREncoderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class CBOREncoderTests: XCTestCase {
102102
"a": 1,
103103
"b": [2, 3]
104104
]
105-
let encodedMapToAny = try! CBOR.encodeMap(mapToAny, options: .init(shouldShortMapKeys: true))
105+
let encodedMapToAny = try! CBOR.encodeMap(mapToAny, options: .init(shouldSortMapKeys: true))
106106
XCTAssertEqual(encodedMapToAny, [0xa2, 0x61, 0x61, 0x01, 0x61, 0x62, 0x82, 0x02, 0x03])
107107

108108
let mapToAnyWithIntKeys: [Int: Any] = [

0 commit comments

Comments
 (0)