ToDateTimeOptions = function (options, required, defaults) {
            options = options === undefined ? null : Internal.ToObject(options);
            options = _.create(options);
            let needDefaults = true;
            if (required === "date" || required === "any") {
                _.forEach(["weekday", "year", "month", "day"], function (prop) {
                    const value = options[prop];
                    if (value !== undefined) {
                        needDefaults = false;
                    }
                });
            }

            if (required === "time" || required === "any") {
                _.forEach(["hour", "minute", "second"], function (prop) {
                    const value = options[prop];
                    if (value !== undefined) {
                        needDefaults = false;
                    }
                });
            }

            if (needDefaults === true && (defaults === "date" || defaults === "all")) {
                _.forEach(["year", "month", "day"], function (prop) {
                    _.defineProperty(options, prop, {
                        value: "numeric",
                        writable: true,
                        enumerable: true,
                        configurable: true,
                    });
                })
            }

            if (needDefaults === true && (defaults === "time" || defaults === "all")) {
                _.forEach(["hour", "minute", "second"], function (prop) {
                    _.defineProperty(options, prop, {
                        value: "numeric",
                        writable: true,
                        enumerable: true,
                        configurable: true,
                    });
                })
            }

            return options;
        }
Modifies the options argument to have correct default values

ECMA-402: #sec-todatetimeoptions

@param {Object} options user-provided options object passed as second argument to Intl.DateTimeFormat/toLocale*String
@param {String} required which kind of options must be provided for the call (one of "date", "time", or "any")
@param {String} defaults which kind of options will be set to a default value (one of "date", "time", or "all")
@returns {Object} modified options object