Source

api/internship/import/match-keywords.ts

  1. import { InternshipDefine } from '../../../typings/radgrad';
  2. /**
  3. * Returns the keywords that match the internship. This is a very dumb function just filtering the keywords that don't appear in the internship.description.
  4. * @param {string[]} keywords the keywords to check.
  5. * @param internship the internship to match the keywords.
  6. * @return {string[]} the keywords that match the internship.
  7. */
  8. export const matchKeywords = (keywords: string[], internship: InternshipDefine): string[] => keywords.filter((word) => internship.description.includes(word));