UNPKG

428 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.interpolate = interpolate;
4/**
5 * @internal
6 */
7// eslint-disable-next-line @typescript-eslint/no-explicit-any
8function interpolate(msg, vars) {
9 if (vars === void 0) { vars = {}; }
10 // eslint-disable-next-line no-useless-escape
11 return msg.replace(/\{\{([^\}]+)\}\}/g, function (_, key) { return (key in vars ? vars[key] : _); });
12}