const TAG_CHARACTER_LIMIT = 30;
export const getAppNameIconWhenNoImage = (appName) => {
    const appNameWords = appName.split(" ");
    const testForAlphaNumeric = /[a-zA-Z0-9]/g;
    if (appNameWords.length > 1) {
        let word1Letter;
        let word2Letter;
        for (let i = 0; i < appNameWords[0].length; i++) {
            word1Letter = appNameWords[0][i];
            if (testForAlphaNumeric.test(word1Letter)) {
                break;
            }
        }
        //Reset the regexp
        testForAlphaNumeric.compile();
        for (let j = 0; j < appNameWords[1].length; j++) {
            word2Letter = appNameWords[1][j];
            if (testForAlphaNumeric.test(word2Letter)) {
                break;
            }
        }
        return `${word1Letter.toUpperCase()}${word2Letter.toUpperCase()}`;
    }
    else {
        return appNameWords[0][0].toUpperCase();
    }
};
export function getTruncatedStringWithEllipses(name) {
    if (name.length >= 30) {
        return `${name.substring(0, TAG_CHARACTER_LIMIT - 3)}...`;
    }
    return name;
}
//# sourceMappingURL=helpers.js.map