function validateName(name, value, type, currency) {
    if (!name || !name.match(/(arr|members)-\d*/i)) {
        return type === 'arr' ? `${type}-${value}-${currency}` : `${type}-${value}`;
    }

    return name;
}
@param {string} name
@param {number} value
@param {'arr'|'members'} type
@param {string|null} currency

@returns {string}