export function toArray(value) {
  return Array.isArray(value) ? value : [];
}

export function normalizeWorldFlag(value) {
  return typeof value === 'string' && value.startsWith('world_flag:')
    ? value.slice('world_flag:'.length)
    : value;
}

export function createError(message, statusCode) {
  const error = new Error(message);
  error.statusCode = statusCode;
  return error;
}
