mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Handle internal implementations better (nw)
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user