Update index.js

Modified function/event regex