Added toJSArray function to plugin, to let it work independently from the repo