INNER CODE UNIT · JavaScript

DAY_MS

bostrot/wsl2-distro-manager · n8n/licensing/seat_check.js:33

const DAY_MS = 24 * 60 * 60 * 1000;

function parseDevices(raw) {
  if (Array.isArray(raw)) return raw.filter((d) => d && typeof d.id === 'string');
  if (typeof raw !== 'string' || !raw.trim()) return [];
  try {
    const parsed = JSON.parse(raw);
    return Array.isArray(parsed)
      ? parsed.filter((d) => d && typeof d.id === 'string')
      : [];
  } catch (e) {
    return [];
  }
}

function clientIp(headers) {
  const h = headers || {};
  const forwarded = String(h['x-forwarded-for'] || '').split(',')[0].trim();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…