function bestFitFormatMatcherScore(options, format) {
        var score = 0;
        if (options.hour12 && !format.hour12) {
            score -= removalPenalty;
        }
        else if (!options.hour12 && format.hour12) {
            score -= additionPenalty;
        }
        for (var _i = 0, DATE_TIME_PROPS_1 = DATE_TIME_PROPS; _i < DATE_TIME_PROPS_1.length; _i++) {
            var prop = DATE_TIME_PROPS_1[_i];
            var optionsProp = options[prop];
            var formatProp = format[prop];
            if (optionsProp === undefined && formatProp !== undefined) {
                score -= additionPenalty;
            }
            else if (optionsProp !== undefined && formatProp === undefined) {
                score -= removalPenalty;
            }
            else if (optionsProp !== formatProp) {
                // extra penalty for numeric vs non-numeric
                if (isNumericType(optionsProp) !==
                    isNumericType(formatProp)) {
                    score -= differentNumericTypePenalty;
                }
                else {
                    var values = ['2-digit', 'numeric', 'narrow', 'short', 'long'];
                    var optionsPropIndex = values.indexOf(optionsProp);
                    var formatPropIndex = values.indexOf(formatProp);
                    var delta = Math.max(-2, Math.min(formatPropIndex - optionsPropIndex, 2));
                    if (delta === 2) {
                        score -= longMorePenalty;
                    }
                    else if (delta === 1) {
                        score -= shortMorePenalty;
                    }
                    else if (delta === -1) {
                        score -= shortLessPenalty;
                    }
                    else if (delta === -2) {
                        score -= longLessPenalty;
                    }
                }
            }
        }
        return score;
    }
Credit: https://github.com/andyearnshaw/Intl.js/blob/0958dc1ad8153f1056653ea22b8208f0df289a4e/src/12.datetimeformat.js#L611
with some modifications
@param options
@param format