function getUntil(data, character, ignoreInString = true) {
    if (!data) {
        return '';
    }
    let stringType = null;
    let resp = '';
    let c = null;
    try {
        for (let idx = 0; idx < data.length; ++idx) {
            c = data[idx];
            if (ignoreInString) {
                if (c == stringType && data[idx - 1] != '\\') {
                    stringType = null;
                    resp += c;
                    continue;
                }
                if (c == "'" && !stringType) {
                    stringType = "'";
                } else if (c == '"' && !stringType) {
                    stringType = '"';
                } else if (c == '`' && !stringType) {
                    stringType = '`';
                }
            }
            if (c == character && !stringType) {
                return resp;
            }
            resp += c;
        }
        return resp;
    } catch (err) {
        return resp;
    }
}
Getting the string until a character to be found.
@param {string} data content
@param {string} character character that will stop the search
@param {boolean} ignoreInString If 'true', the 'character' won't be searched in the string.
@returns