Versions

  • v8

    9/17/2024
    Open: Version
    Changes from v7 to v8
    +1
    -0
    ⦚ 3 unchanged lines ⦚

    // include like
    type PrefixWithZero<T extends number, U extends number> = T extends U ? `0${T}`
    : `${T}`;
    ⦚ 4 unchanged lines ⦚
    ⦚ 3 unchanged lines ⦚

    // include like
    // validation + predicate + callback
    type PrefixWithZero<T extends number, U extends number> = T extends U ? `0${T}`
    : `${T}`;
    ⦚ 4 unchanged lines ⦚
  • v7

    9/17/2024
    Open: Version
    Changes from v6 to v7
    +1
    -0
    ⦚ 7 unchanged lines ⦚

    type Hours = PrefixWithZero<HoursDigits, SingleDigits>;
    type Hours2 = PrefixWithZero<1, SingleDigits>;
    ⦚ 7 unchanged lines ⦚

    type Hours = PrefixWithZero<HoursDigits, SingleDigits>;
    // union with 1 item
    type Hours2 = PrefixWithZero<1, SingleDigits>;
  • v6

    9/17/2024
    Open: Version
    Changes from v5 to v6
    +1
    -1
    // union - array likef
    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;
    ⦚ 7 unchanged lines ⦚
    // union - array like
    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;
    ⦚ 7 unchanged lines ⦚
  • v5

    9/17/2024
    Open: Version
    Changes from v4 to v5
    +1
    -0
    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;
    ⦚ 7 unchanged lines ⦚
    // union - array likef
    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;
    ⦚ 7 unchanged lines ⦚
  • v4

    9/17/2024
    Open: Version
    Changes from v3 to v4
    +2
    -1
    ⦚ 5 unchanged lines ⦚
    : `${T}`;

    type Hours = PrefixWithZero<HoursDigits, SingleDigits>;
    ⦚ 5 unchanged lines ⦚
    : `${T}`;

    type Hours = PrefixWithZero<HoursDigits, SingleDigits>;
    type Hours2 = PrefixWithZero<1, SingleDigits>;
  • v3

    9/17/2024
    Open: Version
    Changes from v2 to v3
    +1
    -0
    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;

    type PrefixWithZero<T extends number, U extends number> = T extends U ? `0${T}`
    : `${T}`;

    type Hours = PrefixWithZero<HoursDigits, SingleDigits>;
    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;

    // include like
    type PrefixWithZero<T extends number, U extends number> = T extends U ? `0${T}`
    : `${T}`;

    type Hours = PrefixWithZero<HoursDigits, SingleDigits>;
  • v2

    9/17/2024
    Open: Version
    Changes from v1 to v2
    +0
    -0
    ⦚ 7 unchanged lines ⦚
    ⦚ 7 unchanged lines ⦚
  • v1

    9/17/2024
    Open: Version
    Changes from v0 to v1
    +1
    -80
    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;

    // naive - hardcoded ugliness
    type DoubleDigitMinutes =
    | 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
    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;

    type PrefixWithZero<T extends number, U extends number> = T extends U ? `0${T}`
    : `${T}`;

    type Hours = PrefixWithZero<HoursDigits, SingleDigits>;
  • v0

    9/17/2024
    Open: Version
    +86
    -0

    type SingleDigits = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
    type HoursDigits = SingleDigits | 10 | 11 | 12;

    // naive - hardcoded ugliness
    type DoubleDigitMinutes =
    | 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
Updated: September 17, 2024