feat: Working on node builder
This commit is contained in:
14
Sources/CliDoc/Modifiers/AnyModifier.swift
Normal file
14
Sources/CliDoc/Modifiers/AnyModifier.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
public struct AnyNodeModifier: NodeModifier {
|
||||
@usableFromInline
|
||||
let modifier: any NodeModifier
|
||||
|
||||
@inlinable
|
||||
public init<N: NodeModifier>(_ modifier: N) {
|
||||
self.modifier = modifier
|
||||
}
|
||||
|
||||
@inlinable
|
||||
public func render(_ node: any NodeRepresentable) -> any NodeRepresentable {
|
||||
modifier.render(node)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user