Function format

  • Format a SemVer object into a string.

    Parameters

    • version: SemVer

      The SemVer to format

    Returns string

    The string representation of a semantic version.

    import { format } from "@std/semver/format";
    import { assertEquals } from "@std/assert";

    const semver = {
    major: 1,
    minor: 2,
    patch: 3,
    };
    assertEquals(format(semver), "1.2.3");