1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/icss-utils/lib/replaceValueSymbols.js

20 lines
583 B
JavaScript
Raw Normal View History

2023-12-18 13:12:25 +08:00
"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;