Ejemplo n.º 1
0
        public JSValue From <T>(T value)
        {
            var writer = new JSValueTreeWriter();

            writer.WriteValue(value);
            return(writer.TakeValue());
        }
Ejemplo n.º 2
0
        public static void WriteObjectProperties <T>(this IJSValueWriter writer, T value)
        {
            var treeWriter = new JSValueTreeWriter();

            treeWriter.WriteValue(value);
            foreach (var property in treeWriter.TakeValue().AsObject())
            {
                writer.WriteObjectProperty(property.Key, property.Value);
            }
        }