Function semver

  • Best-effort semver matcher. The supplied version will be tested against the supplied range.

    Parameters

    • version: string

      The to-be tested semantic version string.

    • range: string

      The range to test the version against.

    Returns boolean

    Whether version satisfies range.

    Example

    Test '1.2.3' against '>2 <1 || ~1.2.*':

    import { semver } from '@sgrud/core';

    semver('1.2.3', '>2 <1 || ~1.2.*'); // true

    Example

    Test '1.2.3' against '~1.1':

    import { semver } from '@sgrud/core';

    semver('1.2.3', '~1.1'); // false

Generated using TypeDoc