Handle internal implementations better (nw)

This commit is contained in:
Matt Nadareski
2025-01-11 22:00:26 -05:00
parent 4f6354802f
commit 457ddf67d9
35 changed files with 1845 additions and 924 deletions

View File

@@ -799,6 +799,26 @@ namespace SabreTools.Core
#endregion
#region Reading
/// <summary>
/// Read an item array from a given key, if possible
/// </summary>
public static T[]? ReadItemArray<T>(this DictionaryBase self, string key) where T : DictionaryBase
{
var items = self.Read<T[]>(key);
if (items == default)
{
var single = self.Read<T>(key);
if (single != default)
items = [single];
}
return items;
}
#endregion
#region Suffix Generation
/// <summary>