Fix signature of functions in log and logValues and add tests

This commit is contained in:
Aria 2025-08-05 19:05:17 -05:00
parent ed5bf3b3fc
commit 3b6777e259
2 changed files with 41 additions and 3 deletions

View file

@ -852,14 +852,14 @@ export class Pattern {
);
}
log(func = (_, hap) => `[hap] ${hap.showWhole(true)}`, getData = (_, hap) => ({ hap })) {
log(func = (hap) => `[hap] ${hap.showWhole(true)}`, getData = (hap) => ({ hap })) {
return this.onTrigger((...args) => {
logger(func(...args), undefined, getData(...args));
}, false);
}
logValues(func = id) {
return this.log((_, hap) => func(hap.value));
return this.log((hap) => func(hap.value));
}
//////////////////////////////////////////////////////////////////////