Skip to content

Commit ba82021

Browse files
authored
fixed separated typo (#59)
1 parent fb76924 commit ba82021

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Sources/Elementary/Core/Html+Attributes.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ public struct HTMLAttributeMergeAction: Sendable {
2626
public static var ignoring: Self { .init(mergeMode: .ignoreIfSet) }
2727

2828
/// Appends the new value to the existing value, separated by the specified string.
29+
@available(*, deprecated, renamed: "appending(separatedBy:)")
2930
public static func appending(seperatedBy: String) -> Self { .init(mergeMode: .appendValue(seperatedBy)) }
31+
32+
/// Appends the new value to the existing value, separated by the specified string.
33+
public static func appending(separatedBy: String) -> Self { .init(mergeMode: .appendValue(separatedBy)) }
3034
}
3135

3236
public extension HTMLAttribute {

Sources/Elementary/HtmlAttributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ public extension HTMLAttribute where Tag: HTMLTrait.Attributes.Global {
1212
}
1313

1414
static func `class`(_ value: String) -> Self {
15-
HTMLAttribute(name: "class", value: value, mergedBy: .appending(seperatedBy: " "))
15+
HTMLAttribute(name: "class", value: value, mergedBy: .appending(separatedBy: " "))
1616
}
1717

1818
static func data(_ key: String, value: String) -> Self {
1919
HTMLAttribute(name: "data-\(key)", value: value)
2020
}
2121

2222
static func style(_ value: String) -> Self {
23-
HTMLAttribute(name: "style", value: value, mergedBy: .appending(seperatedBy: ";"))
23+
HTMLAttribute(name: "style", value: value, mergedBy: .appending(separatedBy: ";"))
2424
}
2525

2626
static func title(_ value: String) -> Self {

Tests/ElementaryTests/AttributeRenderingTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ final class AttributeRenderingTests: XCTestCase {
6161
func testRespectsCustomMergeMode() async throws {
6262
try await HTMLAssertEqual(
6363
br(.id("1"), .data("bar", value: "baz"))
64-
.attributes(.id("2").mergedBy(.appending(seperatedBy: "-")))
64+
.attributes(.id("2").mergedBy(.appending(separatedBy: "-")))
6565
.attributes(.id("3").mergedBy(.ignoring))
66-
.attributes(.data("bar", value: "baq").mergedBy(.appending(seperatedBy: ""))),
66+
.attributes(.data("bar", value: "baq").mergedBy(.appending(separatedBy: ""))),
6767
#"<br id="1-2" data-bar="bazbaq">"#
6868
)
6969
}

0 commit comments

Comments
 (0)