function getSecretDetails(text = "") {
    let results = {
        prefix: null,
        password: "",
    }

    if (typeof text == 'string' && text.length > 0) {
        let index = text.search(multiLineSecretRegEx);

        // assume first line
        if (index == -1) {
            results.password = text.split(/[\n\r]+/, 1)[0].trim();
        } else {
            const secret = text.substring(index).split(/[\n\r]+/, 1)[0].trim();
            // only take first instance of "prefix: "
            index = secret.search(": ");
            results.prefix = secret.substring(0, index);
            results.password = secret.substring(index+2);
        }
    }

    return results;
}
Extract secret password and prefix from raw text string
Private
@param {string} text
@returns {object}