🐛 Bug Report
The ftl2js function throws a TypeError for trying to "read properties of null" when a message has attributes but no pattern.
To Reproduce
let ftl = `
app =
.name = Hello
`;
let data = ftl2js(ftl);
The problem seems to be that the getTypeName function simply assumes that it will be passed a valid object and does no checks for null, and a message with no pattern parses to a null value. Having a message with no pattern but one or more attributes is valid fluent syntax.
Expected behavior
An exception is not thrown.
Your Environment
- runtime version: Electron v30.0.1, Node v20.11.1
- module version: fluent_conv: 3.3.0
- os: Windows
🐛 Bug Report
The
ftl2jsfunction throws a TypeError for trying to "read properties of null" when a message has attributes but no pattern.To Reproduce
The problem seems to be that the
getTypeNamefunction simply assumes that it will be passed a valid object and does no checks fornull, and a message with no pattern parses to anullvalue. Having a message with no pattern but one or more attributes is valid fluent syntax.Expected behavior
An exception is not thrown.
Your Environment