Source

Linq2vk / src / UserAPI / Common / DataKind.fs

Full commit
namespace Linq2vk.Core.Implementation

module DataKind =

    open Newtonsoft.Json.Linq
    
    let (|JsonData|JsonArr|JsonReturnCode|) (s:string) =
//        printfn "(%s)" s
        if s.[0] = '{' then
            let jo = JObject.Parse s
            let (b, d) = jo.TryGetValue("ok")
            if b then
                JsonReturnCode (int d)
            else
                JsonData jo
        else
            JsonArr (JArray.Parse s)