Skip to content

Commit

Permalink
Add sequence initialiser
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdeem committed Jun 13, 2024
1 parent f62add5 commit 5640eae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/ScreamURITemplate/VariableProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ extension TypedVariableDictionary: TypedVariableProvider {}
public struct SequenceVariableProvider: VariableProvider, ExpressibleByArrayLiteral {
let sequence: any Sequence<VariableProvider>

public init(sequence: any Sequence<VariableProvider>) {
self.sequence = sequence
}

public init(arrayLiteral elements: VariableProvider...) {
sequence = elements
self.init(sequence: elements)
}

public subscript(_ name: String) -> VariableValue? {
Expand Down

0 comments on commit 5640eae

Please sign in to comment.