"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Adds a property to an object if the property exists and value is not undefined. Creates a new object if it doesn't exist.
 * Returns the resulting object.
 */
function set(container, property, value) {
    if (property != null && value !== undefined) {
        if (container == null) {
            container = {};
        }
        if (typeof container.set === 'function') {
            container.set(property, value);
        }
        else {
            container[property] = value;
        }
    }
    return container;
}
exports.default = set;
