This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/icss-utils/lib/replaceValueSymbols.js

20 lines
583 B
JavaScript
Raw Permalink Normal View History

2019-08-11 18:48:02 +00: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;