module.exports = (pattern, data) => {
    if (typeof pattern !== 'string' || !pattern || !data) {
        return pattern;
    }

    return pattern.replace(/\$\{([^\{\}]+)\}/g, (match, key) => data[key]);
};
