feat: Adds psychrometrics calculator.

This commit is contained in:
2025-03-06 13:41:38 -05:00
parent e0e5b10a34
commit ee577003d5
13 changed files with 1386 additions and 7 deletions

View 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)
}
}