"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var _ = require("lodash");
/**
 * Determines the properties of the given data object by using the model mapping.
 * If only one property is given, it is assumed to be the matching one.
 *
 * @param data The data object to match
 * @param properties The array of properties of root schema
 * @param filterPredicate used to filter properties of the given data
 * @return The matching {@link Property}
 */
exports.matchContainerProperty = function (data, properties, filterPredicate) {
    // TODO improve handling
    var filtered = properties.filter(filterPredicate(data));
    if (filtered.length > 1) {
        console.warn('More than one matching container property was found for the given data', data);
    }
    return _.head(filtered);
};
//# sourceMappingURL=container.util.js.map