function transformJSFBTLeaves(tree) {
  if (typeof tree === 'string') {
    return tree;
  }
  if (isTableJSFBTTreeLeaf(tree)) {
    return jsfbtLeafToPatternString(tree);
  }

  for (const key of Object.keys(tree)) {
    tree[key] = transformJSFBTLeaves(tree[key]);
  }
  return tree;
}
Converts JSFBT leaf objects into the mangled text (type: PatternString)
@return JSFBT structure that emulates the output of MakeHaste or the fbt-translate transform