fixed bug where withBase would silence a pattern if freq was unset

This commit is contained in:
tyow
2026-02-20 13:10:16 -05:00
parent 4a801ab668
commit 8520044f3e
+1
View File
@@ -149,6 +149,7 @@ export const withBase = register('withBase', (b, pat) => {
let hVal = hap.value;
const isObject = typeof hVal === 'object';
let freq = isObject ? hVal.freq : hVal;
if (!freq) return hap;
freq = (freq * base) / originalBase;
hap.value = isObject ? { ...hap.value, freq } : { freq };
return hap;