All files landlineNumberGenerators.ts

100% Statements 36/36
100% Branches 0/0
100% Functions 17/17
100% Lines 36/36

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98          1x     3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       3x 3x       1x        
// src/landlineNumberGenerators.ts
// Generator functions for European test landline numbers
 
import { SupportedCountry } from './mobileNumberGenerators';
 
export const generateTestLandlineNumber: Record<SupportedCountry, () => string> = {
  Netherlands: () => {
    // 010 99xxxxxx (Rotterdam, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `010 99${random.toString().padStart(6, '0')}`;
  },
  Germany: () => {
    // 030 99xxxxx (Berlin, test range)
    const random = Math.floor(10000 + Math.random() * 90000);
    return `030 99${random.toString().padStart(5, '0')}`;
  },
  Belgium: () => {
    // 02 99xxxxxx (Brussels, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `02 99${random.toString().padStart(6, '0')}`;
  },
  France: () => {
    // 01 99xxxxxx (Paris, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `01 99${random.toString().padStart(6, '0')}`;
  },
  UnitedKingdom: () => {
    // 020 3999xxxx (London, test range)
    const random = Math.floor(1000 + Math.random() * 9000);
    return `020 3999${random.toString().padStart(4, '0')}`;
  },
  Spain: () => {
    // 91 99xxxxx (Madrid, test range)
    const random = Math.floor(10000 + Math.random() * 90000);
    return `91 99${random.toString().padStart(5, '0')}`;
  },
  Italy: () => {
    // 06 99xxxxxx (Rome, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `06 99${random.toString().padStart(6, '0')}`;
  },
  Austria: () => {
    // 01 99xxxxxx (Vienna, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `01 99${random.toString().padStart(6, '0')}`;
  },
  Switzerland: () => {
    // 044 99xxxxxx (Zurich, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `044 99${random.toString().padStart(6, '0')}`;
  },
  Sweden: () => {
    // 08 99xxxxxx (Stockholm, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `08 99${random.toString().padStart(6, '0')}`;
  },
  Norway: () => {
    // 21 99xxxxxx (Oslo, test range)
    const random = Math.floor(1000000 + Math.random() * 9000000);
    return `21 99${random.toString().padStart(6, '0')}`;
  },
  Denmark: () => {
    // 33 99xxxx (Copenhagen, test range)
    const random = Math.floor(1000 + Math.random() * 9000);
    return `33 99${random.toString().padStart(4, '0')}`;
  },
  Finland: () => {
    // 09 99xxxxxx (Helsinki, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `09 99${random.toString().padStart(6, '0')}`;
  },
  Portugal: () => {
    // 21 99xxxxxx (Lisbon, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `21 99${random.toString().padStart(6, '0')}`;
  },
  Ireland: () => {
    // 01 99xxxxxx (Dublin, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `01 99${random.toString().padStart(6, '0')}`;
  },
  Turkey: () => {
    // 212 99xxxxxx (Istanbul, test range)
    const random = Math.floor(100000 + Math.random() * 900000);
    return `212 99${random.toString().padStart(6, '0')}`;
  },
  Morocco: () => {
    // 0522 99xxxx (Casablanca, test range)
    const random = Math.floor(1000 + Math.random() * 9000);
    return `0522 99${random.toString().padStart(4, '0')}`;
  },
};
 
export const landlineNumberGenerators = {
  generateTestLandlineNumber,
};