namespace OpenNest.Data;
///
/// Normalized matching key for names in company lists (customers, materials).
///
public static class SharedListNames
{
///
/// Returns the name trimmed, with internal whitespace runs collapsed to one
/// space, in invariant upper case. Names that differ only in spacing or case
/// share a key. A null or blank name has the empty key.
///
public static string Key(string? name) =>
name == null
? ""
: string.Join(' ', name.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries))
.ToUpperInvariant();
}