REORG+histo

This commit is contained in:
Paul Schneider 2021-09-05 15:44:47 +01:00
commit 6dd76ac1a5
28 changed files with 948 additions and 159 deletions

View file

@ -0,0 +1,33 @@
namespace isnd.Helpers
{
public static class PackageIdHelpers
{
internal static bool SeparatedByMinusMatch(string id, string q)
{
foreach (var part in id.Split('-'))
{
if (part.StartsWith(q, System.StringComparison.OrdinalIgnoreCase)) return true;
}
return false;
}
internal static bool CamelCaseMatch(string id, string query)
{
// Assert.False (q==null);
if (string.IsNullOrEmpty(query)) return true;
while (id.Length > 0)
{
int i = 0;
while (id.Length > i && char.IsLower(id[i])) i++;
if (i == 0) break;
id = id.Substring(i);
if (id.StartsWith(query, System.StringComparison.OrdinalIgnoreCase)) return true;
}
return false;
}
}
}