verifyUniqueEntityName = function(parsedContent, entityName, entityType, range, checkTypesAlignment) {
    // Duplicate entity names are not allowed
    // Entity name cannot be same as a role name
    let matchType = "";
    let entityFound = parsedContent.LUISJsonStructure.flatListOfEntityAndRoles.find(item => {
        if (item.name === entityName) {
            if (!checkTypesAlignment && item.type !== entityType) {
                matchType = `Entity names must be unique. Duplicate definition found for "${entityName}".`;
                return true;
            } else if (checkTypesAlignment) {
                matchType = `Child entity names must be unique. Duplicate definition found for child entity "${entityName}".`;
                return true;
            }
        } else if (item.roles.includes(entityName)) {
            matchType = `Entity name cannot be the same as a role name. Duplicate definition found for "${entityName}".`;
            return true;
        }
    });
    if (entityFound !== undefined) {
        let errorMsg = `${matchType} Prior definition - '@ ${entityFound.type} ${entityFound.name}${entityFound.roles.length > 0 ? ` hasRoles ${entityFound.roles.join(',')}` : ``}'`;
        let error = BuildDiagnostic({
            message: errorMsg,
            range: range
        })
        throw (new exception(retCode.errorCode.INVALID_INPUT, error.toString(), [error]));
    }
}
Helper function to verify that the requested entity is unique.
@param {Object} parsedContent 
@param {String} entityName 
@param {String} entityType 
@param {Object} range 
@param {Boolean} checkTypesAlignment