.ts
TypeScript
(application/typescript)
/**
 * Removes comments and extra spacing from a string.
 *
 * @param str The string to process.
 * @returns The processed string.
 */
export default function removeCommentsAndSpacing(str = "") {
  return str.replace(/\/\*.*\*\//g, " ").replace(/\s+/g, " ");
}