dist/utilify.esm.js
function semverCompare(v1, v2) {
        var semver = /^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
        var validate = function validate(version) {
            if (!validateHelpers.isString(version)) {
                throw new TypeError('Invalid argument: expected string');
            }
            if (!semver.test(version)) {
                throw new Error('Invalid argument: not valid semver');
            }
        };

        [v1, v2].forEach(validate);

        var pa = v1.split('.');
        var pb = v2.split('.');

        for (var i = 0; i < 3; i++) {
            var na = Number(pa[i]);
            var nb = Number(pb[i]);

            if (na > nb) {
                return 1;
            }

            if (nb > na) {
                return -1;
            }

            if (!isNaN(na) && isNaN(nb)) {
                return 1;
            }

            if (isNaN(na) && !isNaN(nb)) {
                return -1;
            }
        }

        return 0;
    }
function semverCompare(v1, v2) {
        var semver = /^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;
        var validate = function validate(version) {
            if (!validateHelpers.isString(version)) {
                throw new TypeError('Invalid argument: expected string');
            }
            if (!semver.test(version)) {
                throw new Error('Invalid argument: not valid semver');
            }
        };

        [v1, v2].forEach(validate);

        var pa = v1.split('.');
        var pb = v2.split('.');

        for (var i = 0; i < 3; i++) {
            var na = Number(pa[i]);
            var nb = Number(pb[i]);

            if (na > nb) {
                return 1;
            }

            if (nb > na) {
                return -1;
            }

            if (!isNaN(na) && isNaN(nb)) {
                return 1;
            }

            if (isNaN(na) && !isNaN(nb)) {
                return -1;
            }
        }

        return 0;
    }
function semverCompare ( v1 , v2 ) { var semver = / ^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$ / i ; var validate = function validate ( version ) { if ( ! validateHelpers . isString ( version ) ) { throw new TypeError ( 'Invalid argument: expected string' ) ; } if ( ! semver . test ( version ) ) { throw new Error ( 'Invalid argument: not valid semver' ) ; } } ; [ v1 , v2 ] . forEach ( validate ) ; var pa = v1 . split ( '.' ) ; var pb = v2 . split ( '.' ) ; for ( var i = 0 ; i < 3 ; i ++ ) { var na = Number ( pa [ i ] ) ; var nb = Number ( pb [ i ] ) ; if ( na > nb ) { return 1 ; } if ( nb > na ) { return - 1 ; } if ( ! isNaN ( na ) && isNaN ( nb ) ) { return 1 ; } if ( isNaN ( na ) && ! isNaN ( nb ) ) { return - 1 ; } } return 0 ; }
Compare two semver version strings, returning -1, 0, or 1
If the semver string `v1` is greater than `v2`, return 1. If the semver string `v2` is greater than `v1`, return -1. If `v1` equals `v2`, return 0

@from @semver-compare
@category Global
@param  {String} v1 Your semver to compare
@param  {String} v2 Compared semver
@return {Number}    -1, 0, 1
Compare two semver version strings returning - 1 0 or 1 If the semver string v1 is greater than v2 return 1 . If the semver string v2 is greater than v1 return - 1 . If v1 equals v2 return 0