You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
583 B
20 lines
583 B
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
var matchValueName = /[$#]?[\w-\.]+/g;
|
|
|
|
var replaceValueSymbols = function replaceValueSymbols(value, replacements) {
|
|
var matches = void 0;
|
|
while (matches = matchValueName.exec(value)) {
|
|
var replacement = replacements[matches[0]];
|
|
if (replacement) {
|
|
value = value.slice(0, matches.index) + replacement + value.slice(matchValueName.lastIndex);
|
|
matchValueName.lastIndex -= matches[0].length - replacement.length;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
|
|
exports.default = replaceValueSymbols; |