Not exactly but part of it can be found in 'libraries/chain/util/reward.ccp'. I didn't use anything from the official source for my calculation, because there are major differences between C++ and JS code / dependencies.
I guess it would take more time to convert the C code to JavaScript than just build it from scratch and the best way for me always is 'learning by doing' (without just copying existing code).
Not exactly but part of it can be found in 'libraries/chain/util/reward.ccp'. I didn't use anything from the official source for my calculation, because there are major differences between C++ and JS code / dependencies.
I guess it would take more time to convert the C code to JavaScript than just build it from scratch and the best way for me always is 'learning by doing' (without just copying existing code).