extractNestedTemplatesAndComponents = (
  { componentFoundIndex: lastIndex, babel, stringOutput, type, interpolatedVariableNames },
  node,
) => {
  let componentFoundIndex = lastIndex;
  if (node.type === 'JSXElement') {
    // perform the interpolation of components just as we do in a normal Trans setting
    const subText = `<${componentFoundIndex}>${mergeChildren(
      node.children,
      babel,
    )}</${componentFoundIndex}>`;
    componentFoundIndex += 1;
    stringOutput.push(subText);
  } else if (node.type === 'TaggedTemplateExpression') {
    // a nested date``/number``/plural`` etc., extract whatever is inside of it
    const [variableNames, childText, newIndex] = getTextAndInterpolatedVariables(
      node.tag.name,
      node,
      componentFoundIndex,
      babel,
    );
    interpolatedVariableNames.push(...variableNames);
    componentFoundIndex = newIndex;
    stringOutput.push(childText);
  } else if (node.type === 'Identifier') {
    // turn date`${thing}` into `thing, date`
    stringOutput.push(`${node.name}, ${type}`);
  } else if (node.type === 'TemplateElement') {
    // convert all whitespace into a single space for the text in the tagged template literal
    stringOutput.push(node.value.cooked.replace(/\s+/g, ' '));
  } else {
    // unknown node type, ignore
  }
  return { componentFoundIndex, babel, stringOutput, type, interpolatedVariableNames };
}
iterate over a node detected inside a tagged template literal

This is a helper function for `extractVariableNamesFromQuasiNodes` defined below

this is called using reduce as a way of tricking what would be `.map()`
into passing in the parameters needed to both modify `componentFoundIndex`,
`stringOutput`, and `interpolatedVariableNames`
and to pass in the dependencies babel, and type. Type is the template type.
For "date``" the type will be `date`. for "number``" the type is `number`, etc.