Guest User

Untitled

a guest
Mar 21st, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. let
  2. seed= Value.ResourceExpression(List.Range),
  3. func = (_) => try Value.Metadata(Value.Type(_))[Documentation.Name] otherwise
  4. try Value.ResourceExpression(_)[Name] otherwise "function",
  5. trace = (_) => if _ is function then func(_)
  6. else if _ is type then "type"
  7. else if _ is null then "null"
  8. else if _ is list then List.Accumulate(_,{},(s,c)=>s&{@trace(c)})
  9. else if _ is record then List.Accumulate(Record.FieldNames(_),[],(s,c)=>Record.AddField(s,c,@trace(Record.Field(_,c))))
  10. else Text.From(_),
  11. out = Json.FromValue(trace(seed)),
Add Comment
Please, Sign In to add comment