3dmol / 3Dmol.js

WebGL accelerated JavaScript molecular graphics library
Other
770 stars 191 forks source link

Refactor ts files parser utils #756

Closed prajwalkulkarni closed 5 months ago

prajwalkulkarni commented 5 months ago

:dizzy: Changelog

:star: Improved typesafety in TS files located in parser/utils. :star: Changed var to let and const as applicable. :star: Moved constant value identifiers outside of function definition to avoid unnecessary re-initialization. :star: Added strict equality check

prajwalkulkarni commented 5 months ago

I aim to improve the type-safety across the complete codebase in iterations. In this PR, the type of a few properties in Atom interface are still defined as any(and at few a places the types are also asserted as any, e.g: In MMTF.ts) as I'm still wrapping my head around the codebase and the type of the properties will be updated in further iterations.

8/13 files of parsers/utils are refactored in this PR, kindly confirm if I should push the refactored changes of the remaining 5 files of parsers/utils in this PR or create a separate PR. Thanks!