function createTypeCheckFunction(typesArray) {
  const types = new Set(typesArray);
  return (node) => types.has(node?.type);
}
@param {string[]} typesArray
@returns {(node: Node | Comment) => Boolean}