Skip to content

Instantly share code, notes, and snippets.

@ilamanov
Last active January 24, 2022 11:06
Show Gist options
  • Save ilamanov/748b4fdc71624d66db42fa39937653a5 to your computer and use it in GitHub Desktop.
Save ilamanov/748b4fdc71624d66db42fa39937653a5 to your computer and use it in GitHub Desktop.
categorizer
function CATEGORIZE(transaction) {
const [card, date, description, amount] = transaction[0]
if (description.toLowerCase().includes("starbucks") ||
description.toLowerCase().includes("taqueria")) {
return "takeout"
} else if (description.toLowerCase().includes("carwash") ||
description.toLowerCase().includes("chevron") ||
description.toLowerCase().includes("exxon")) {
return "car"
} else if (description.toLowerCase().includes("youtubepremium") ||
description.toLowerCase().includes("netflix") ||
description.toLowerCase().includes("spotify") ||
description.toLowerCase().includes("amazon")) {
return "subscriptions"
} else {
return ""
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment