JavaScript function that flips brackets direction
Your function seems to work fine, but you can condense it a bit by search for all bracket types in one regex replace with the following pattern:
/[\(\)\[\]\{\}]/g

and then use the replace function that takes a replace function as argument:
const brs = &quot;()({}{[][&quot;;
function flipBracketsDirection(str) {
  return str.replace(/[\(\)\[\]\{\}]/g, br =&gt; brs[brs.indexOf(br) + 1]);
}

brs holds all the replaceable brackets with the opening brackets twice, so brs[brs.indexOf(')') + 1] finds '(' as the next char in brs;
You could also let brs be an object like:
const brs =
{
  &quot;(&quot;: ')',
  &quot;)&quot;: '(',
  &quot;{&quot;: '}',
  &quot;}&quot;: '{',
  &quot;[&quot;: ']',
  &quot;]&quot;: '[',
};

and then cquery it as:
function flipBracketsDirection(str) {
  return str.replace(/[\(\)\[\]\{\}]/g, br =&gt; brs[br]);
}

Your version actually query the string nine times, where the above only iterates it once.
As an alternative to the 'sophisticated' brs dictionary-solution, you could just create a function with a switch statement:
function swapBracket(br) {
  switch (br) {
    case '(': return ')';
    case ')': return '(';
    case '{': return '}';
    case '}': return '{';
    case '[': return ']';
    case ']': return '[';
  }
}

And call that instead, this way:
function flipBracketsDirection(str: string) {
  return str.replace(/[\(\)\[\]\{\}]/g, swapBracket);
}

flipBracketsDirection('}hello{');
// will return {hello}


Your tests cases could also be simplified, so it is easier to maintain - for instance like:
  let strs = [
    ')hello(',
    'this has ]some text[',
    'flip }any{ brackets',
    'even with )))]multiple[((( brackets'
  ];

  for (let s of strs) {
    let t = flipBracketsDirection(s);
    console.log(t);
    console.log(flipBracketsDirection(t));
    console.log(&quot;&quot;);
  }


Both the above suggestions should conform to the DRY principle.