feat: Adds psychrometrics calculator.
This commit is contained in:
40
Sources/Routes/URLRoutingExtensions.swift
Normal file
40
Sources/Routes/URLRoutingExtensions.swift
Normal file
@@ -0,0 +1,40 @@
|
||||
import URLRouting
|
||||
|
||||
// Allow the use of a field key enum as the `name` parameter, to avoid
|
||||
// stringly type name fields.
|
||||
public extension Field {
|
||||
|
||||
@inlinable
|
||||
init<Key>(
|
||||
_ name: Key,
|
||||
default defaultValue: Value.Output? = nil,
|
||||
@ParserBuilder<Substring> _ value: () -> Value
|
||||
) where Key: RawRepresentable, Key.RawValue == String {
|
||||
self.init(name.rawValue, default: defaultValue, value)
|
||||
}
|
||||
|
||||
@inlinable
|
||||
init<Key, C>(
|
||||
_ name: Key,
|
||||
_ value: C,
|
||||
default defaultValue: Value.Output? = nil,
|
||||
) where Key: RawRepresentable, Key.RawValue == String,
|
||||
Value == Parsers.MapConversion<Parsers.ReplaceError<Rest<Substring>>, C>
|
||||
{
|
||||
self.init(name.rawValue, value, default: defaultValue)
|
||||
}
|
||||
|
||||
@inlinable
|
||||
init<Key>(
|
||||
_ name: Key,
|
||||
default defaultValue: Value.Output? = nil
|
||||
)
|
||||
where
|
||||
Key: RawRepresentable, Key.RawValue == String,
|
||||
Value == Parsers.MapConversion<
|
||||
Parsers.ReplaceError<Rest<Substring>>, Conversions.SubstringToString
|
||||
>
|
||||
{
|
||||
self.init(name.rawValue, default: defaultValue)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user