overload every

This commit is contained in:
Felix Roos
2022-04-22 13:47:16 +02:00
parent 1029f8674c
commit 967a9bb4a4
+4
View File
@@ -591,6 +591,10 @@ export class Pattern {
}
every(n, func) {
if (func instanceof Pattern) {
const p = func;
func = (x) => x.union(p);
}
const pat = this;
const pats = Array(n - 1).fill(pat);
pats.unshift(func(pat));