Merge pull request 'fixed bug where withBase would silence a pattern if freq was unset' (#1994) from tyow/localstrudel:withbase-fix into main
Reviewed-on: https://codeberg.org/uzu/strudel/pulls/1994
This commit is contained in:
commit
4cc63b8b01
1 changed files with 1 additions and 0 deletions
|
|
@ -149,6 +149,7 @@ export const withBase = register('withBase', (b, pat) => {
|
||||||
let hVal = hap.value;
|
let hVal = hap.value;
|
||||||
const isObject = typeof hVal === 'object';
|
const isObject = typeof hVal === 'object';
|
||||||
let freq = isObject ? hVal.freq : hVal;
|
let freq = isObject ? hVal.freq : hVal;
|
||||||
|
if (!freq) return hap;
|
||||||
freq = (freq * base) / originalBase;
|
freq = (freq * base) / originalBase;
|
||||||
hap.value = isObject ? { ...hap.value, freq } : { freq };
|
hap.value = isObject ? { ...hap.value, freq } : { freq };
|
||||||
return hap;
|
return hap;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue