src/language-js/print/template-literal.js/escapeTemplateCharacters
function escapeTemplateCharacters(doc, raw) {
  return mapDoc(doc, (currentDoc) => {
    if (!currentDoc.parts) {
      return currentDoc;
    }

    const parts = currentDoc.parts.map((part) => {
      if (typeof part === "string") {
        return raw
          ? part.replace(/(\\*)`/g, "$1$1\\`")
          : uncookTemplateElementValue(part);
      }

      return part;
    });

    return { ...currentDoc, parts };
  });
}