• Parse a version string into a zero-padded numeric triple.

    A pre-release / build suffix (-beta.1, +build.9) is dropped, surrounding whitespace is trimmed, missing components pad to 0, and any non-numeric component coerces to 0 (never NaN). An empty or nullish input parses to [0, 0, 0] — the identity used for "no migration version stored yet".

    Parameters

    • version: undefined | null | string

      The version string (e.g. "0.7.0"), possibly empty.

    Returns number[]

    A [major, minor, patch] numeric triple.