mirror of
https://github.com/Smaug123/WoofWare.Myriad
synced 2025-12-15 21:35:39 +00:00
Parse numbers from strings, implement general recursion (#12)
This commit is contained in:
@@ -24,15 +24,24 @@ namespace ConsumePlugin
|
||||
module JsonRecordType =
|
||||
/// Parse from a JSON node.
|
||||
let jsonParse (node : System.Text.Json.Nodes.JsonNode) : JsonRecordType =
|
||||
let F =
|
||||
node.["f"].AsArray ()
|
||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<int> ())
|
||||
|> Array.ofSeq
|
||||
|
||||
let E =
|
||||
node.["e"].AsArray ()
|
||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<string> ())
|
||||
|> Array.ofSeq
|
||||
|
||||
let D = InnerType.jsonParse node.["d"]
|
||||
|
||||
let C =
|
||||
node.["hi"].AsArray ()
|
||||
|> Seq.map (fun elt -> elt.GetValue<int> ())
|
||||
|> Seq.map (fun elt -> elt.AsValue().GetValue<int> ())
|
||||
|> List.ofSeq
|
||||
|
||||
let B2 = node.["another-thing"].AsValue ()
|
||||
let B = B2.GetValue<string> ()
|
||||
let B = node.["another-thing"].AsValue().GetValue<string> ()
|
||||
let A = node.["a"].AsValue().GetValue<int> ()
|
||||
|
||||
{
|
||||
@@ -40,4 +49,6 @@ module JsonRecordType =
|
||||
B = B
|
||||
C = C
|
||||
D = D
|
||||
E = E
|
||||
F = F
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user