string.js 405 B

123456789101112
  1. export function getSourcePrefix(source) {
  2. const sourceEmojis = {
  3. // Source used for info messages.
  4. info: "\tℹ️ [INFO]:\t",
  5. // Source used for client to server messages.
  6. client: "\t⬅️ [SENT]:\t",
  7. // Source used for server to client messages.
  8. server: "\t➡️ [RECEIVED]:\t",
  9. }
  10. if (Object.keys(sourceEmojis).includes(source)) return sourceEmojis[source]
  11. return ""
  12. }