That will give you a clear code, clear mapping and...
# suitescript
a
That will give you a clear code, clear mapping and only one loop... not nested or unnecessary loops.
s
or just use NFT instead of writing this code again.
a
Or put it in your own NetSuite tools/library and reuse it without the need of using TypeScript or any third party library.