Closed bennypowers closed 10 months ago
Thanks for the bug report! We're sorry about TypeScript errors. Can you try 4.5.1 and let us know if this fixes the problem for you?
https://github.com/hebcal/hebcal-es6/commit/dd5b87f00f249494067000faecfab36c6ed2b6ef seems to fix it
if you adopt ts sources, let me suggest using export const flags = {/*..*/} as const
instead, which is more flexible
Shavua tov.
The
flags
dict is defined as a typescriptconst enum
. This can lead to difficulties:https://www.typescriptlang.org/play?target=9&jsx=0#code/JYWwDg9gTgLgBAbzgMwDYEMDmBnOBfFKCEOAcgAEALAUwCMBjdVAenumtIG4AobtgO2zxkcALxwA8rQBW1ejAB0yIiACi-GFGDVsACimz5C6hq07d3OFbjNmccjGwBaagA8wcmC6hEoALjgAd0p0GGoAN2ooS2s0LGxuAEpEnj4IQQhUagVUCExdZBTeAWxM7Nz8uJwFAGEACQBBAHFEoA
Input:
Output:
The correct flag for
CHAG
is1
. Code relying on flags.CHAG and thus-compiled will fail. I worked around this by copying the flags table into my code. A better solution would be to export the table as an objectAn even better solution would be to vend predicates instead of bitmasks.
Besoros tovos