Extracting Tags from a Schema.Union of TaggedStructs

Any way to make below code work? I am trying to get all the tags from Schema.Union of TaggedStructs

  const tag1 = Schema.TaggedStruct("tag1", {})
  const tag2 = Schema.TaggedStruct("tag2", {})

  const union = Schema.Union(tag1, tag2)

  console.log(union.members.map(m => m.fields._tag))


I am expecting string[] but I am getting Schema.Tag[]
Was this page helpful?