// @ts-check /** * Returns true if the utm value is not empty and does not contain the "n/a" value * * @param {string} utm * @returns {boolean} */ export const isUtmValueAcceptable = (utm) => { if (!utm) return false; // Check if utm var contains "n/a" or "n\a", exclude spaces, only if n/a is alone return !utm .replace(/ /g, '') .toLowerCase() .match(/^(n\/a|n\\a)$/); };