26 lines
944 B
JavaScript
26 lines
944 B
JavaScript
shadow$provide.module$node_modules$pixi_DOT_js$lib$assets$utils$createStringVariations = function(global, require, module, exports) {
|
|
function processX(base, ids, depth, result, tags) {
|
|
const id = ids[depth];
|
|
for (let i = 0; i < id.length; i++) {
|
|
const value = id[i];
|
|
depth < ids.length - 1 ? processX(base.replace(result[depth], value), ids, depth + 1, result, tags) : tags.push(base.replace(result[depth], value));
|
|
}
|
|
}
|
|
exports.createStringVariations = function(string) {
|
|
const result = string.match(/\{(.*?)\}/g), tags = [];
|
|
if (result) {
|
|
const ids = [];
|
|
result.forEach(vars => {
|
|
vars = vars.substring(1, vars.length - 1).split(",");
|
|
ids.push(vars);
|
|
});
|
|
processX(string, ids, 0, result, tags);
|
|
} else {
|
|
tags.push(string);
|
|
}
|
|
return tags;
|
|
};
|
|
};
|
|
|
|
//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$assets$utils$createStringVariations.js.map
|