Skip to content

Commit

Permalink
[update-dist-bot] auto-format and update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
update-dist-bot committed Feb 15, 2024
1 parent 3b35bd5 commit 7643895
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 25 deletions.
64 changes: 44 additions & 20 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ function expandPrefixSuffix(prefix, suffix, tag) {
// replaced with an empty string.
let prefixes = [...new Set(prefix.split(/[\s,]/).filter(Boolean))];
let suffixes = [...new Set(suffix.split(/[\s,]/).filter(Boolean))];
prefixes = prefixes.map(p => p.replaceAll(/<empty-string>/g, ""));
suffixes = suffixes.map(p => p.replaceAll(/<empty-string>/g, ""));
prefixes = prefixes.map((p) => p.replaceAll(/<empty-string>/g, ""));
suffixes = suffixes.map((p) => p.replaceAll(/<empty-string>/g, ""));

// the permutation logic requires at least one element in each list
if (prefixes.length == 0) {
prefixes.push("");
prefixes.push("");
}
if (suffixes.length == 0) {
suffixes.push("");
suffixes.push("");
}
// permute
return prefixes.flatMap((p) => suffixes.map((s) => `${p}${tag}${s}`));
Expand Down

0 comments on commit 7643895

Please sign in to comment.