When enums are not an enum but cloaked like an enum
const InD = require ( "indesign" );
InD.Leading.AUTO === InD.Leading.AUTO // false
InD.Leading.AUTO.valueOf() === InD.Leading.AUTO.valueOf() // false
InD.Leading.AUTO.toString() === InD.Leading.AUTO.toString() // true
InDesign version: (latest) 21.4.1
OS: (latest) Tahoe 26.5.2
Result: trying to use it in any no-string state throws error: "No data available of the requested type."
Simple description:
( leading === InD.Leading.AUTO ) ? fontSize * 1.2 : leading; // throws error above
leading is set to InD.Leading.AUTO so should be TRUE but...
1
vote