"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isMinLength = exports.isOptionEqualToValue = exports.getOptionLabel = exports.convertSearchResultToOption = void 0;
var mdm_sdk_1 = require("@reltio/mdm-sdk");
var convertSearchResultToOption = function (result) {
    return {
        id: result.Id,
        type: result.Type,
        fullAddress: result.Text,
        description: result.Description
    };
};
exports.convertSearchResultToOption = convertSearchResultToOption;
var getOptionLabel = function (option) {
    return typeof option === 'string' ? option : option.fullAddress;
};
exports.getOptionLabel = getOptionLabel;
var isOptionEqualToValue = function (option, value) {
    if (option.type === mdm_sdk_1.AddressType.Container) {
        return false;
    }
    return option.fullAddress === value;
};
exports.isOptionEqualToValue = isOptionEqualToValue;
var isMinLength = function (value, minLength) {
    return (value === null || value === void 0 ? void 0 : value.trim().length) >= minLength;
};
exports.isMinLength = isMinLength;
