Add IndexOf property to WSRequest and Description classes; implement getValue function in recipes-and-patterns.js

This commit is contained in:
2025-10-09 12:02:06 -07:00
parent 5c2a3c97e9
commit ad82130732
20 changed files with 836 additions and 604 deletions

View File

@ -9,7 +9,6 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading;
namespace Adaptation.Shared;
@ -447,12 +446,13 @@ public class FileRead : Properties.IFileRead
{
List<Properties.IDescription> results = new();
Duplicator.Description description;
JsonSerializerOptions jsonSerializerOptions = new() { NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString };
foreach (JsonElement jsonElement in jsonElements)
{
if (jsonElement.ValueKind != JsonValueKind.Object)
throw new Exception();
description = JsonSerializer.Deserialize<Duplicator.Description>(jsonElement.ToString(), jsonSerializerOptions);
description = JsonSerializer.Deserialize(jsonElement.ToString(), Duplicator.SharedDescriptionSourceGenerationContext.Default.Description);
if (description is null)
continue;
results.Add(description);
}
return results;