fixed bug where withBase would silence a pattern if freq was unset
This commit is contained in:
parent
4a801ab668
commit
8520044f3e
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue