Convert

Convert index.js to class function