function updateVersionRange(oldRange, newVersion) {
    const parsedOldRange = parse(oldRange.trim());

    if (parsedOldRange !== null) {
        if (isPinned(parsedOldRange) === true) {
            // The old version was pinned, so the new should also be pinned
            return newVersion;
        }

        const parsedNewVersion = parse(newVersion);

        if (isExpectedNewVersion(parsedNewVersion) === false) {
            return newVersion;
        }

        const newVersionRange = tryVersionRangeUpdate(
            parsedOldRange,
            parsedNewVersion
        );

        // All this is kind of error prone so let's do a sanity check if everything's ok
        if (semver.satisfies(newVersion, newVersionRange) === true) {
            return newVersionRange;
        }
    }

    return fallbackRange(newVersion);
}
Tries to apply the newVersion while maintaining the range (see https://github.com/peerigon/updtr/issues/47)
This is kind of risky because there are tons of semver possibilities. That's why this
function is very conservative in accepting semver ranges. If the range is not easily updatable,
we opt-out to npm's default caret operator.

@param {string} oldRange
@param {string} newVersion
@returns {string}