Estación meteorológica Netatmo - Anemómetro - Dirección del viento - Puntos cardinales

Estoy utilizando una función que se encuentra en el archivo server/utils/cardinalpoint.js:

/** 
 * Dado "0-360" devuelve la dirección cardinal más cercana "N/NE/E/SE/S/SW/W/NW"  
 */
function getCardinalDirection(angle) {
    if (typeof angle === 'string') {
        angle = parseInt(angle);
    }
    if (angle <= 0 || angle > 360 || typeof angle === 'undefined') {
        return '☈';
    }
    const arrows = { north: '↑ N', north_north_east: '↗ NNE', north_east: '↗ NE', east: '→ E', south_east: '↘ SE', south_south_east: '↘ SSE', south: '↓ S', south_south_west: '↙ SSW', south_west: '↙ SW', west: '← W', north_west: '↖ NW', north_north_west: '↖ NNW' };
    const directions = Object.keys(arrows);
    const degree = 360 / directions.length;
    angle = angle + degree / 2;
    for (let i = 0; i < directions.length; i++) {
      if (angle >= (i * degree) && angle < (i + 1) * degree) {
          return arrows[directions[i]];
        }
    }
    return arrows['north'];
  }
  module.exports = {
    getCardinalDirection,
  };

Para el ángulo del viento hay 16 direcciones posibles. Pensé que sería más sencillo recuperar el valor como String en la base de datos, pero efectivamente no había pensado en hacerlo en la interfaz de usuario. Veré cómo pasarlo al lado del front-end.