import type { ProductImageStorage } from '../domain/image.js';

export class LocalProductImageStorage implements ProductImageStorage {
  normalizeUrl(url: string): string {
    const trimmed = url.trim();
    if (trimmed.startsWith('/')) {
      return trimmed;
    }
    return new URL(trimmed).toString();
  }
}
