src/utils/tags.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { TAG_REGEX } from 'constants/config';
import { trim } from 'lodash/fp';

export const removeTags = (title: string | undefined) => {
  if (!title) {
    return null;
  }

  const tags = title.match(TAG_REGEX);

  return tags ? trim(title.split(tags[0])[0]) : title;
};