"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Function provides a save string split functionality. If
 * the given string to split is undefined or null an empty
 * string array is returned.
 *
 * @param str string to split
 * @param separator separator of the split
 * @returns string []
 */
function split(str, separator) {
    if (separator === void 0) { separator = ' '; }
    if (str === undefined || str === null) {
        return [];
    }
    return str.split(separator);
}
exports.split = split;
/**
 * Function returns the number value of the given key, if
 * the key is not found the key is added and the current map
 * size is set as value.
 *
 * @param idMap Map with string key and number value
 * @param name string key
 * @returns number of the given key.
 */
function getDigit(idMap, name) {
    if (!idMap.has(name)) {
        idMap.set(name, idMap.size);
    }
    return idMap.get(name);
}
exports.getDigit = getDigit;
function getLetter(idMap, name) {
    var digit = getDigit(idMap, name);
    return String.fromCharCode('A'.charCodeAt(0) + (digit % 5));
}
exports.getLetter = getLetter;
//# sourceMappingURL=Strings.js.map